# Unloading a .swf

**URL:** <https://forum.kirupa.com/t/unloading-a-swf/179431>\
**Category:** Uncategorized\
**Created:** [February 20, 2006, 4:29am UTC](https://forum.kirupa.com/t/unloading-a-swf/179431 "2006-02-20T04:29:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![deucescorner](https://avatars.discourse-cdn.com/v4/letter/d/57b2e6/32.png) [@deucescorner](https://forum.kirupa.com/u/deucescorner)\
**Post date:** [February 20, 2006, 4:29am UTC](https://forum.kirupa.com/t/unloading-a-swf/179431/1 "2006-02-20T04:29:42Z")

</div>

So here goes,

This is on my main timeline (below), as you can see it is calling individual \_mc to play depending on what btn you choose (pretty straight forward). Each \_mc has a stop(); at frame 2 and 10 (except buttonHandler(1) 'cause I want it to load automatically). The buttonHandler(4) is just loading a .swf, on frame 2; loadMovie(“brugmansia\_gallery.swf”,1000); and on frame 11 unloadMovie(“brugmansia\_gallery.swf”);

I’m using the kirupa gallery with xml and thumbnails, I don’t if that makes a difference

var btnNum;  
function buttonHandler(who:Number){  
if(btnNum==who)return;  
\_root.container\_mc[“menu”+btnNum+"\_mc"].play();  
\_root.container\_mc[“menu”+who+"\_mc"].play();  
btnNum=who;  
}  
\_root.buttons\_mc.home\_btn.onRelease = function(){  
\_root.buttonHandler(1);  
}  
\_root.buttons\_mc.portfolio\_btn.onRelease = function(){  
\_root.buttonHandler(2);  
}  
\_root.buttons\_mc.favorites\_btn.onRelease = function(){  
\_root.buttonHandler(3);  
}  
\_root.buttons\_mc.merchandises\_btn.onRelease = function(){  
\_root.buttonHandler(4);  
}  
\_root.buttons\_mc.contact\_btn.onRelease = function(){  
\_root.buttonHandler(5);  
}  
\_root.buttonHandler(1);

My question is how do i get the .swf to leave when you click on a different button?
