hi all
in my app
i've add new object
new tesObj:TesObj = new TesObj();
addChild(tesObj);
and the after i give it instance name
tesObj.name = "idTesObj";
but when i want to remove it, it doesnt work
because hasn't found id "idTesObj"
//removeChild(idTesObj);
any help ?
this complete code :
import flash.events.MouseEvent;
var tesObj:TesObj = new TesObj();
tesObj.name = "idTesObj";
addSmall.addEventListener(MouseEvent.CLICK, addSmallFunction);
function addSmallFunction(e:MouseEvent):void
{
addChild(tesObj);
removeSmall.addEventListener(MouseEvent.CLICK, removeSmallFunction);
}
function removeSmallFunction(e:MouseEvent):void
{
tes("clip1");
}
function tes(n:String):void
{
//removeChild(n);
trace(n);
}
thanks for advice
regards
cholid_ridwan