# \[MX\]AS Button problem

**URL:** <https://forum.kirupa.com/t/mx-as-button-problem/158353>\
**Category:** flash\
**Created:** [August 9, 2005, 9:26am UTC](https://forum.kirupa.com/t/mx-as-button-problem/158353 "2005-08-09T09:26:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rawnewdlz](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@rawnewdlz](https://forum.kirupa.com/u/rawnewdlz)\
**Post date:** [August 9, 2005, 9:26am UTC](https://forum.kirupa.com/t/mx-as-button-problem/158353/1 "2005-08-09T09:26:53Z")

</div>

Hi, I’m using this on code on a main swf:

on (release) {  
if (\_root.currMovie == undefined) {  
\_root.currMovie = “home”;  
container.loadMovie(“home.swf”);  
} else if (\_root.currMovie != “home”) {  
if (container.\_currentframe\>=container.midframe) {  
\_root.currMovie = “home”;  
container.play();  
}  
}  
}

And when it goes to a the home.swf there is a sub menu w/btns and I used this:

on (release) {  
loadMovieNum(“web.swf”, 52);  
}

Now when one of those pics(pic01.swf,pic02.swf,etc) in web.swf are open theres a btn that closes it with:

on (press) {  
unloadMovie(container2);  
}

Now the problem I’m having is if I wanted to click on a different link in the “main” swf, what woud I do to close the web.swf inside home.swf because the home.swf will go away but web.swf will stay there while a new link(from the main.swf) is loaded?

this is the hierarchy:main.swf\>home.swf\>web.swf\>pic01.swf

thanks in advance.
