# Button to new scene, in movie clips?

**URL:** <https://forum.kirupa.com/t/button-to-new-scene-in-movie-clips/9187>\
**Category:** Uncategorized\
**Created:** [December 6, 2002, 6:23pm UTC](https://forum.kirupa.com/t/button-to-new-scene-in-movie-clips/9187 "2002-12-06T18:23:03Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhero](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@dhero](https://forum.kirupa.com/u/dhero)\
**Post date:** [December 6, 2002, 6:23pm UTC](https://forum.kirupa.com/t/button-to-new-scene-in-movie-clips/9187/1 "2002-12-06T18:23:03Z")

</div>

Hi there,

I’ve been following a flash tutorial, It’s a complicated piece. You’ll have to look at it to see for yourselves.  
My main problem is that I would like to try to add buttons to the scrolling ‘menu’ movie clips, that would enable me to go to a new scene. I’ve tried the ‘\_parent.gotoAndPlay(2)’ etc, but due to my very basic knowledge of action-scripting I can’t get it to work.

Anyone have any suggestions, or wanna try?

Thanks.

This is in flash 5 but i’ll take MX scripting if I have to

---

<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:** [December 6, 2002, 6:30pm UTC](https://forum.kirupa.com/t/button-to-new-scene-in-movie-clips/9187/2 "2002-12-06T18:30:08Z")

</div>

You can’t change scenes from inside a movie clip.

You need to add the actions to a frame on the main timeline, then target that frame with your gotoAndPlay() action on your button.

Works the same in both 5 and MX.

---

<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:** [December 6, 2002, 7:15pm UTC](https://forum.kirupa.com/t/button-to-new-scene-in-movie-clips/9187/3 "2002-12-06T19:15:46Z")

</div>

Thanks for your help, Lost.

Lovely site by the way.

I read that you can’t change scenes from within a movie clip, but then I came across this:  
[http://raven.ubalt.edu/classes/old/pbds668.185\_Sp02/gotoProblem.cfm](http://raven.ubalt.edu/classes/old/pbds668.185_Sp02/gotoProblem.cfm)

The guy on that page says its possible, and it would be cool if works, but no joy

---

<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:** [December 6, 2002, 7:18pm UTC](https://forum.kirupa.com/t/button-to-new-scene-in-movie-clips/9187/4 "2002-12-06T19:18:10Z")

</div>

Yeah, the method he used is what I said to do 🙂

You need to do \_parent.gotoAndPlay(frame#) on the button in the movie clip to a frame on your main timeline that contains the gotoAndPlay(“Scene”,frame#) AS.

ANd his other method involves variables, which you can try, and it does work 🙂

---

<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:** [December 6, 2002, 7:22pm UTC](https://forum.kirupa.com/t/button-to-new-scene-in-movie-clips/9187/5 "2002-12-06T19:22:08Z")

</div>

Ohh, I see.

Thanks again, I’ll go and try that now.🙂

---

<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:** [December 6, 2002, 7:24pm UTC](https://forum.kirupa.com/t/button-to-new-scene-in-movie-clips/9187/6 "2002-12-06T19:24:19Z")

</div>

Good Luck 🙂

---

<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:** [December 6, 2002, 8:05pm UTC](https://forum.kirupa.com/t/button-to-new-scene-in-movie-clips/9187/7 "2002-12-06T20:05:18Z")

</div>

Oh man, this just isn’t working.

This is what i get if i send it to frame 2:

Scene=Scene 1, Layer=Menu, Frame=1: Line 1: Statement must appear within on handler  
\_parent.gotoAndPlay(2)

I know i’m being cheeky, but do you think you could have a quick look at it to see where i’m going wrong? The red button on menu 1 should take me to frame 2 of the main timeline but i get the above message and a white screen

Hope you can help, thanks

---

<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:** [December 6, 2002, 8:09pm UTC](https://forum.kirupa.com/t/button-to-new-scene-in-movie-clips/9187/8 "2002-12-06T20:09:23Z")

</div>

Well even without looking at your .fla I can see the problem.

You put the code on the button… but you forgot the on handler

```auto
on (press) {
	_parent.gotoAndPlay(2);
}

```

---

<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:** [December 6, 2002, 8:16pm UTC](https://forum.kirupa.com/t/button-to-new-scene-in-movie-clips/9187/9 "2002-12-06T20:16:03Z")

</div>

Oh well done Lost.

I can’t thank you enough for your help, the mistakes probably look a bit silly to you, but i’m really not very good.

Regards

Dhero

---

<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:** [December 6, 2002, 8:18pm UTC](https://forum.kirupa.com/t/button-to-new-scene-in-movie-clips/9187/10 "2002-12-06T20:18:58Z")

</div>

Over time you will improve. Flash isn’t something you can pick up in a day, it is something you have to learn and get used to over time and practice 🙂

---

<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:** [December 6, 2002, 9:19pm UTC](https://forum.kirupa.com/t/button-to-new-scene-in-movie-clips/9187/11 "2002-12-06T21:19:15Z")

</div>

Lost, i have come to the conclusion that you are one of the most helpfull people on this kirupa forum. Not the only person that helps, mind you, but the one that i see most frequently helping flashers. Props to you, dude!!
