# Can I call gotoPlay from \_level2 for \_level0?

**URL:** <https://forum.kirupa.com/t/can-i-call-gotoplay-from--level2-for--level0/4756>\
**Category:** Uncategorized\
**Created:** [August 19, 2002, 6:01am UTC](https://forum.kirupa.com/t/can-i-call-gotoplay-from--level2-for--level0/4756 "2002-08-19T06:01:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![3dron](https://avatars.discourse-cdn.com/v4/letter/3/2acd7d/32.png) [@3dron](https://forum.kirupa.com/u/3dron)\
**Post date:** [August 19, 2002, 6:01am UTC](https://forum.kirupa.com/t/can-i-call-gotoplay-from--level2-for--level0/4756/1 "2002-08-19T06:01:43Z")

</div>

I have an swf loaded into \_level0. On button release I want gotoAndPlay a certain frame label in an swf loaded into an MC named Host on \_level0 to.

I have the following:

on (release) {  
\_level0.host.gotoAndPlay(“Main”, “MainStart”);  
unloadMovieNum (2);  
}

The unload part looks fine, and I am back to my orginal page. But the page did not jump to ‘MainStart’.

What am I forgetting?

RR

---

<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:** [August 19, 2002, 9:45am UTC](https://forum.kirupa.com/t/can-i-call-gotoplay-from--level2-for--level0/4756/2 "2002-08-19T09:45:48Z")

</div>

HI there mate,

i’m just looking at the code, and i may be getting the wrong end of the stick here… but why do you have “MAIN” And “MAINSTART” within the gotoAndPlay command ?

see, i’m thinking that either “main” OR “mainStart” is the name of the loaded MC (i could obviously be wrong… so if i assume that MAIN is the name of the MC and that “MainStart” is the frameLabel …then the code should be

(MY CODE)  
on (release) {  
\_level0.host.MAIN.gotoAndPlay(“MainStart”);  
unloadMovieNum (2);  
}

(YOUR CODE)  
on (release) {  
\_level0.host.gotoAndPlay(“Main”, “MainStart”);  
unloadMovieNum (2);  
}

this is just me taking a stab at it, and trying to understand what you’ve done ?

Cheers

Ket

ps: where are you loading the SWF from? (that is, it is definately loaded before all this code runs ?.. AND you might want to try and use \_root instead of \_level0 (i remember, for some reason a MC of mine went tits up…for what in reality, was no reason at all ?..)

---

<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:** [August 19, 2002, 10:22am UTC](https://forum.kirupa.com/t/can-i-call-gotoplay-from--level2-for--level0/4756/3 "2002-08-19T10:22:32Z")

</div>

which movie are you unloading? Are you unloading the same movie you tried to play? If you are, the command to unload it follows immediately after you call for the movie to play, hence, you would not see anything because the movie has not had enough time to play.

that was purely a stab in the dark, for I don’t know what you’re trying to unload in your command.

---

<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:** [August 19, 2002, 10:33am UTC](https://forum.kirupa.com/t/can-i-call-gotoplay-from--level2-for--level0/4756/4 "2002-08-19T10:33:13Z")

</div>

yeah, you may want to place the unload action on the last frame of the loaded movie, so that it actually plays the whole way through ?..

OR you could be a bit sly and place a variable on \_root which is true (initially) then in the code in the loaded MC …last frame… you tell it to change the variable to FLASE…

and then place an IF statement in the first frame of the loaded movie… checking the status of the variable…

if variable “true” - play the movie  
if variable “false” unload move

that way you’re able to resuse the MC without having to Unload it each time … (i’m not sure if this MC is gonna be used once and so placing an unload command is no problem OR if it may be used later… and you don’t want the MC Unload automatically ? )

Cheers

Ket

---

<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:** [August 19, 2002, 3:16pm UTC](https://forum.kirupa.com/t/can-i-call-gotoplay-from--level2-for--level0/4756/5 "2002-08-19T15:16:10Z")

</div>

Main is the scene label of the swf sitting on level0.
