To remove a dynamic displayObject completely you need
removeChild or removeChildAt(index)
remove all the refrences to the displayObject
nulling the displayObject
But this is my case
//here recto is a MovieClip on stage
//i creat a dynamic display Object named newMc
var newMc:MovieClip =new MovieClip();
newMc.graphics.beginFill(0x000000,1);
newMc.graphics.drawRect(0,0,10,10);
newMc.graphics.endFill();
recto.addChildAt(newMc,1);
//i refrence the newMc using refrenceMc
var referenceMc:MovieClip = recto.getChildAt(1) as MovieClip ;
recto.removeChildAt(1);
refrenceMc =null;
I can’t use [COLOR=“Red”]newMc=null.[/COLOR]
I must reference the [COLOR=“Red”]newMc[/COLOR] using other MovieClip.
So by following above procedure I can’t get rid of [COLOR=“Red”]newMc[/COLOR]
as it is still accessible.So is there any way to nullify [COLOR=“Red”]newMc[/COLOR] via refrencing
And one thing again does
refrenceMc = recto.getChildAt(1) as MovieClip;
is refrencing newMc or creating a copy of it.
I believe that it is refrencing newMc but I am not sure why nulling [COLOR=“Red”]refrenceMc[/COLOR] has effect on [COLOR=“Red”]newMc[/COLOR]
I am still searching for solution and if anything comes I will surely let you know.
Thanks