# Unloading swf when going to different frame label

**URL:** <https://forum.kirupa.com/t/unloading-swf-when-going-to-different-frame-label/319179>\
**Category:** Uncategorized\
**Created:** [February 11, 2011, 2:10am UTC](https://forum.kirupa.com/t/unloading-swf-when-going-to-different-frame-label/319179 "2011-02-11T02:10:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lndlyb4](https://avatars.discourse-cdn.com/v4/letter/l/c77e96/32.png) [@lndlyb4](https://forum.kirupa.com/u/lndlyb4)\
**Post date:** [February 11, 2011, 2:10am UTC](https://forum.kirupa.com/t/unloading-swf-when-going-to-different-frame-label/319179/1 "2011-02-11T02:10:23Z")

</div>

Hi,

I have the following code on a frame label called “allemande” (frame 890). The first part loads a swf when I click a button called “allemande” that sends me to this frame. This part works correctly.

The second part is code that sends the timeline to the “home” frame label when I click the “home” button. This works OK too.

I would like to insert code that will unload the “allemande\_slideshow” swf when I click the “home” button to go back to the “home” frame label.

/_############### loads allemande slideshow swf ############_/  
var myrequest\_allemande:URLRequest=new URLRequest  
(“[http://floramultimedia.com/musicGarden/slideshowProFiles/allemande/allemande\_slideshow.swf](http://floramultimedia.com/musicGarden/slideshowProFiles/allemande/allemande_slideshow.swf)”);  
var myloader\_allemande:Loader=new Loader();  
myloader\_allemande.load(myrequest\_allemande);  
stage.addChild(myloader\_allemande);

/_############### home button ######################_/  
btn\_home.addEventListener(MouseEvent.CLICK, go\_home\_from\_allemande);  
function go\_home\_from\_allemande (e:MouseEvent):void{  
MovieClip(root).gotoAndStop (“home”);

}

I added the code below on the “home” frame label and it removed the allemande\_slideshow.swf just fine when I click the “home” label, but when I click the “allemande” button, the allemande\_slideshow.swf does not re-load.

stage.removeChild(myloader\_allemande);

Any guidance would be appreciated.
