# Button action script to next scene

**URL:** <https://forum.kirupa.com/t/button-action-script-to-next-scene/182990>\
**Category:** flash\
**Created:** [March 23, 2006, 12:10am UTC](https://forum.kirupa.com/t/button-action-script-to-next-scene/182990 "2006-03-23T00:10:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fps\_gamergirl](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@fps\_gamergirl](https://forum.kirupa.com/u/fps_gamergirl)\
**Post date:** [March 23, 2006, 12:10am UTC](https://forum.kirupa.com/t/button-action-script-to-next-scene/182990/1 "2006-03-23T00:10:16Z")

</div>

on(release){  
\_root.gotoAndPlay(“Game”);}

I had this attached to a button and there was no result, although the button worked as a symbol, but the scripting was not working

---

<div class="post-metadata">

**Author:** ![yem224](https://avatars.discourse-cdn.com/v4/letter/y/b38774/32.png) [@yem224](https://forum.kirupa.com/u/yem224)\
**Post date:** [March 27, 2006, 9:28pm UTC](https://forum.kirupa.com/t/button-action-script-to-next-scene/182990/2 "2006-03-27T21:28:13Z")

</div>

hey,  
this works for me:

```auto
 on (release) {
gotoAndPlay("SceneName",1);
}

```

Hope this helps.  
yem224

---

<div class="post-metadata">

**Author:** ![lunatic](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lunatic](https://forum.kirupa.com/u/lunatic)\
**Post date:** [March 27, 2006, 9:32pm UTC](https://forum.kirupa.com/t/button-action-script-to-next-scene/182990/3 "2006-03-27T21:32:14Z")

</div>

If you absolutely HAVE to use scenes (they suck) then use frame labels, it’s much better. Select the first frame of the scene you are trying to go to (like “Game”). In the Properties panel you’ll see a place to enter a frame label. Type something in DIFFERENT than the name of the scene, like “GameFrame1” or something (no quotes). Frame labels are case sensitive so make sure it’s something you can remember easily.

Then on the code for your button use

```auto
on(release){
gotoAndPlay("GameFrame1");}

```

:hr:

_edit_ you may have to use \_root.gotoAndPlay(“GameFrame1”)

---

<div class="post-metadata">

**Author:** ![fps\_gamergirl](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@fps\_gamergirl](https://forum.kirupa.com/u/fps_gamergirl)\
**Post date:** [March 27, 2006, 9:36pm UTC](https://forum.kirupa.com/t/button-action-script-to-next-scene/182990/4 "2006-03-27T21:36:42Z")

</div>

> [@yem224](#):
>
> hey,  
> this works for me:
> 
> ```auto
> on (release) {
> gotoAndPlay("SceneName",1);
> }
> 
> ```
> 
> Hope this helps.  
> yem224

Yeah I have tried that too, but it doesn’t seem to work, but i will try typing the code in again just to make sure if i made some error or something. Sometimes, after you type the code in, and go to check the code (aka: the little green check mark on the Actions panel), it says there is no code error or something like that,but sometimes there really is an error and Flash doesn’t see it as one. It really differs with the different versions, but in this case, its not the problem. So again, i will check and see. Thanks for all the help. I can always depend on you guys!  
~FP5\_64//\3R 6!rl (yesh this is in 1337((leet)))
