# Controlling main swf from a loaded swf?

**URL:** https://forum.kirupa.com/t/controlling-main-swf-from-a-loaded-swf/218886
**Category:** Uncategorized
**Created:** [March 12, 2007, 5:37am UTC](https://forum.kirupa.com/t/controlling-main-swf-from-a-loaded-swf/218886 "2007-03-12T05:37:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Juhanthus](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@Juhanthus](https://forum.kirupa.com/u/Juhanthus)
#### Post date: [March 12, 2007, 5:37am UTC](https://forum.kirupa.com/t/controlling-main-swf-from-a-loaded-swf/218886/1 "2007-03-12T05:37:24Z")

</div>

Heya all, I’m new here hope somebody could help me to solve this problem I’m having. \>\_\<

So I have an SWF loaded into my main SWF by using this command:  
[COLOR=Red]this.createEmptyMovieClip(“here”,1);  
here.loadMovie(“subflash.swf”);[/COLOR]

Now what I wanted to do is to hide the button that loads the “subflash.swf” when its being clicked. And show the button again when I close the “subflash.swf”.

For your information, I have made a button in “subflash.swf” to close it using the following command:  
[COLOR=Sienna]\_root.here.unloadMovie(“subflash.swf”);[/COLOR]

The thing is… if I don’t hide the button, user can click on the button and the whole “subflash.swf” will be reloaded, i want to avoid that.

I’m kinda new with flash, so far I have no idea how to solve this problem… hopefully someone can enlighten me. XD
