Hey guys
So I loaded a swf into another swf like so
correctURL being my external swf variable
function startLoad(){
var mRequest:URLRequest = new URLRequest(correctURL.toString());
mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
mLoader.load(mRequest);
}
function onCompleteHandler(loadEvent:Event) {
var gmc:MovieClip = new MovieClip();
gmc.x = 266;
gmc.y = 67;
addChild(gmc);
gmc.addChild(loadEvent.currentTarget.loader);
}
But i'm struggling to unload the damn thing when I want to replace it with another swf.
The code i'm trying is this
function closeAllStreams(e:Event) {
e.currentTarget.loader.unloadAndStop();
gmc = null;
gmc.removeChild(e.currentTarget.loader);
trace("unloaded");
}
mLoader.contentLoaderInfo.addEventListener(Event.UNLOAD, closeAllStreams);
I'm just not having any luck as I can still hear the old sound over the top.
I don't want to access the loaded swf's variables either or i'd just cheat haha.
Thanks