# Buttons In A Movie Not Working with Scenes?

**URL:** <https://forum.kirupa.com/t/buttons-in-a-movie-not-working-with-scenes/21640>\
**Category:** flash\
**Created:** [May 24, 2003, 6:33am UTC](https://forum.kirupa.com/t/buttons-in-a-movie-not-working-with-scenes/21640 "2003-05-24T06:33:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeyyu](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@jeyyu](https://forum.kirupa.com/u/jeyyu)\
**Post date:** [May 24, 2003, 6:33am UTC](https://forum.kirupa.com/t/buttons-in-a-movie-not-working-with-scenes/21640/1 "2003-05-24T06:33:02Z")

</div>

Hello Everyone:  
I know the subject line sounds weird. but this is the scenario:

I have 2 Scenes: Scene 1 and Scene 2.

In Scene 2, I created a movie clip with some buttons like

link 1 | link 2 | link 3 | back to Main |

so these are all buttons inside a movie clip called mov1

The back to Main button inside the movie clip is supposed to go back to previous scene. I had some code like  
on (release) {  
gotoAndPlay(“Scene 1”, 1);  
};

but It did not work. After tearing my hair and \*\*\*\*ing the computer for a bit, I deleted the back to Main button from the movie clip and created a separate button on Scene 2 (as apposed to a button on a movie clip and using the clip on scene 2) called “Back to Main” right next to Link 3 and same code as above and It works!!

I don’t know why this happens? Any idea why?.

Thanks!!.

Jeyyu.: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:** [May 24, 2003, 8:07am UTC](https://forum.kirupa.com/t/buttons-in-a-movie-not-working-with-scenes/21640/2 "2003-05-24T08:07:10Z")

</div>

If your commands are nested in a movieClip, you may have to tell Flash to go back to the main movie. Try:  
[AS]  
on (release) {  
\_root.gotoAndPlay(“Scene 1”, 1);  
};  
[/AS]  
Hope that helps  
(-:

---

<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:** [May 24, 2003, 3:54pm UTC](https://forum.kirupa.com/t/buttons-in-a-movie-not-working-with-scenes/21640/3 "2003-05-24T15:54:57Z")

</div>

That won’t work either Freddy.

You have to give your your first frame in the scene you want to go to a frame label (right click on the frame and open the properties panel), then with the gotoAndPlay you have to target the main timeline of that movie and play the label [AS]\_root.gotoAndPlay(“frameLabelYouUsed”);[/AS]

---

<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:** [May 24, 2003, 5:58pm UTC](https://forum.kirupa.com/t/buttons-in-a-movie-not-working-with-scenes/21640/4 "2003-05-24T17:58:34Z")

</div>

Good to know. I try not to use scenes. If it was all in one scene, would it work then?

---

<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:** [May 24, 2003, 6:01pm UTC](https://forum.kirupa.com/t/buttons-in-a-movie-not-working-with-scenes/21640/5 "2003-05-24T18:01:03Z")

</div>

If it is all in one scene then yes it will work. It just doesn’t work across scenes because of the way Flash handles scenes.

I try not to use scenes either, they are evil.

---

<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:** [May 24, 2003, 6:09pm UTC](https://forum.kirupa.com/t/buttons-in-a-movie-not-working-with-scenes/21640/6 "2003-05-24T18:09:01Z")

</div>

Here here. Thank you for letting me know. I do not want to be a ‘giver of false info’.  
(-:

---

<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:** [May 24, 2003, 9:11pm UTC](https://forum.kirupa.com/t/buttons-in-a-movie-not-working-with-scenes/21640/7 "2003-05-24T21:11:01Z")

</div>

It worked. Thanks Guys. Do u always use \_root when assigning actions to reference the main movie or only in specific scenarios.

Yeah, scenes suck, but I am just exprimenting right now. I would probably use loadMovie() in real examples.

Thanks again.

jeyyu.

---

<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:** [May 24, 2003, 9:14pm UTC](https://forum.kirupa.com/t/buttons-in-a-movie-not-working-with-scenes/21640/8 "2003-05-24T21:14:19Z")

</div>

You use \_root to get back the very first timeline in the hierarchy.

In a single movie this is the main timeline, but when you call in a movie via loadMovie() the \_root timeline is the very first timeline of the main movie and not of the loaded movies. So in that case you will need to use \_parent or “this” (no quotes), depending on how your stuff is set up it is different usage.
