Hi,
I’m working on a project in which I’m loading an external AS2 swf file onto the main stage.
To load the movie I’m using this code:
var request:URLRequest = new URLRequest(filename);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.load(request);
In the loadComplete function I’m adding the loaded swf into the a movieclip (which is assinged to the class in which this code is written):
function loadComplete(event:Event):void {
trace("Complete");
addChild(event.currentTarget.content);
}
Thing is, when I use removeChild on the movieclip, I can still hear the sound of the swf file, which means, it wasn’t really unloaded when I removed the movieclip containing it.
How can I completely unload the swf?
Thanks.