[ASK]how to remove object from display list and memory which added dynamicly
Hi there everyone,
i have a question which i hope you guys can help me with,so the question is :
" how do we remove object( sprite which has an external swf as it's child ) from display and more importantly from memory yet we still can use the same variable to add another object (yes another sprite like the one we removed yet has different content).., "
i did tried the removeChildAt thing it did remove all the child from the display list but i still can hear sound from video running.
here is small scale code of what i'm doing (sorry that i can only give you chunk code of loading and adding)
// var SWFList:XMLList; //used to hold a list of all external swf source,atribute and etc
// var totalSWF:int; //hold the total number of external swf there is to be loaded// var swfLoader:Loader; //instance of loader class used to load the external swf
function loadSWF():void
{
for (var i:Number; i < totalSWF; i++ )swfLoader = new Loader();
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE , onSWFLoadComplete);
swfLoader.load(new URLRequest(SWFList.@source));
}function onSWFLoadComplete(e:Event):void
{
this.stage.addChild(e.target.content);
}
and also if you can give an example of a good method of dynamicly adding object to the stage i would really appreciate it cause i suspect mine's are bad method to used.
thanks everyone.