# \[Flash MX\] loaded movie controlling the source movie

**URL:** <https://forum.kirupa.com/t/flash-mx-loaded-movie-controlling-the-source-movie/19530>\
**Category:** flash\
**Created:** [April 28, 2003, 11:09pm UTC](https://forum.kirupa.com/t/flash-mx-loaded-movie-controlling-the-source-movie/19530 "2003-04-28T23:09:42Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![meisje](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@meisje](https://forum.kirupa.com/u/meisje)\
**Post date:** [April 28, 2003, 11:09pm UTC](https://forum.kirupa.com/t/flash-mx-loaded-movie-controlling-the-source-movie/19530/1 "2003-04-28T23:09:42Z")

</div>

hello there,

say i have a main movie, into this movie is loaded another movie on level\_1.

is there any actionscript that allows a button inside the loaded movie control the main movie? i.o.w. can a button inside the loaded movie tell the main movie to go to another scene?

- i am looking for code for that same button to unload the movie it is in itself… possible?

thanks very much in dvance

meisje

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 28, 2003, 11:56pm UTC](https://forum.kirupa.com/t/flash-mx-loaded-movie-controlling-the-source-movie/19530/2 "2003-04-28T23:56:51Z")

</div>

> **is there any actionscript that allows a button inside the loaded movie control the main movie?**

```auto
_level0.gotoAndPlay("sceneName", frameNumber);

```

> **i am looking for code for that same button to unload the movie it is in itself… possible?**

```auto
_root.unloadMovie();

```

?? =)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 12:10am UTC](https://forum.kirupa.com/t/flash-mx-loaded-movie-controlling-the-source-movie/19530/3 "2003-04-29T00:10:49Z")

</div>

alas it was no go ☹

i typed:

on (release) {  
\_level0.gotoAndPlay(“Scene 2”, 1);  
\_root.unloadMovie();  
}

i also tried with \_parent in front of the root-path but that didn’t work either…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 12:23am UTC](https://forum.kirupa.com/t/flash-mx-loaded-movie-controlling-the-source-movie/19530/4 "2003-04-29T00:23:16Z")

</div>

instead of the scene name and frame number, try with a frame label. go to Scene 2, highlight the first frame, and you’ll see an input field in the properties panel.

the script would change to:

```auto
_level0.gotoAndPlay("frameLabel");

```

as for unloading the swf…  
there’s nothing wrong with the script, if you can’t get it to work… attach your files and i’ll check it out. 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 12:59am UTC](https://forum.kirupa.com/t/flash-mx-loaded-movie-controlling-the-source-movie/19530/5 "2003-04-29T00:59:33Z")

</div>

hey there, i am happy now, after stripping my project to make a lighter upload and testing it… it suddenly worked, hurray =) many thanks kax!

btw, is it possible to make the mainmovie level\_1 right after start-up and load other movies into level\_0? would be handier for me lay-out wise

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 1:07am UTC](https://forum.kirupa.com/t/flash-mx-loaded-movie-controlling-the-source-movie/19530/6 "2003-04-29T01:07:26Z")

</div>

wait wait,

i also found the reason why it didn’t work before stripping my project, i think it was because the button in question was from the library of the mainmovie, only when i converted that button to an internal button (of the loaded movie itself) the code worked…

so my question is, do you know a solution for this?

tia, meisje

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 1:46am UTC](https://forum.kirupa.com/t/flash-mx-loaded-movie-controlling-the-source-movie/19530/7 "2003-04-29T01:46:36Z")

</div>

here are 2 flashfiles with the external button that keeps the movie from unloading, if you could look at it please?

tia, meisje

:toad:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 4:13am UTC](https://forum.kirupa.com/t/flash-mx-loaded-movie-controlling-the-source-movie/19530/8 "2003-04-29T04:13:13Z")

</div>

ok… first off, sorry about the delay. =)

anyway, i might be wrong, but i guess it didn’t worked because once the Button is imported to the movie, the on handler is erased. to solve the problem, give an instance name to the Button and paste this script in the timeline:

```auto
instanceName.onRelease = function() {
	_level0.gotoAndPlay("start");
	_root.unloadMovie(); 
};

```

and don’t forget to replace instanceName with the actual instance name of the Button. =)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 5:07am UTC](https://forum.kirupa.com/t/flash-mx-loaded-movie-controlling-the-source-movie/19530/9 "2003-04-29T05:07:47Z")

</div>

all works now! hurray!

late reply… you have got to be kidding 🙂

thanks for the excellent help

these smilees are all for you

\<:} C:-) :toad:

later, meisje

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 5:12am UTC](https://forum.kirupa.com/t/flash-mx-loaded-movie-controlling-the-source-movie/19530/10 "2003-04-29T05:12:39Z")

</div>

no problem, meisje. =)

and welcome to kirupa forum!! 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 29, 2003, 5:31am UTC](https://forum.kirupa.com/t/flash-mx-loaded-movie-controlling-the-source-movie/19530/11 "2003-04-29T05:31:19Z")

</div>

hurray! 🙂
