Trying to unload a swf via clicking a button, when i exit the frame the previous swf is still there under the new frame. Any ideas
—Button code—
stop();
function onIntro9Click(evt:MouseEvent):void {
gotoAndPlay(1);
}
intro9_btn.addEventListener(MouseEvent.CLICK, onIntro9Click);
----Loading and Unloading the SWF----
//-----------------------LOADING THE GALLERY--------------------//
var ld:Loader = new Loader();
var gal:DisplayObject;
ld.load(new URLRequest(“present.swf”));
ld.contentLoaderInfo.addEventListener(Event.INIT, loadingDone);
function loadingDone(e:Event):void{
gal = e.target.content
addChildAt(gal,0);
}
//------------------------------------------------------------------//
//-------------------UNLOADING THE GALLERY---------------------------//
unload_mc.addEventListener(MouseEvent.CLICK,unloadGal);
function unloadGal(e:MouseEvent):void{
removeChild(gal);
}
//-------------------------------------------------------------------//