# Code for Buttons - Works in One Scene but Not Another

**URL:** <https://forum.kirupa.com/t/code-for-buttons-works-in-one-scene-but-not-another/95082>\
**Category:** Uncategorized\
**Created:** [November 20, 2003, 6:51am UTC](https://forum.kirupa.com/t/code-for-buttons-works-in-one-scene-but-not-another/95082 "2003-11-20T06:51:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![et10yl](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@et10yl](https://forum.kirupa.com/u/et10yl)\
**Post date:** [November 20, 2003, 6:51am UTC](https://forum.kirupa.com/t/code-for-buttons-works-in-one-scene-but-not-another/95082/1 "2003-11-20T06:51:09Z")

</div>

Ok, I’m not quite understanding this. Here is the code that I have put in my Actions layer:

```auto

stop();

btn_1.onRelease = function (){
 this.gotoAndStop(2);
};

btn_2.onRelease = function (){
 this.gotoAndStop(3);
};

btn_3.onRelease = function (){
 this.gotoAndStop(4);
};

btn_4.onRelease = function (){
 this.gotoAndStop(5);
}; 

```

The buttons don’t work - at all. I’ve used this code in a separate scene for a skipIntro button, and it worked fine… Can anyone see anything wrong here? Am I supposed to enter the code elsewhere?

Thanks!
