# Having some menu trouble

**URL:** <https://forum.kirupa.com/t/having-some-menu-trouble/319342>\
**Category:** Uncategorized\
**Created:** [February 17, 2011, 1:05am UTC](https://forum.kirupa.com/t/having-some-menu-trouble/319342 "2011-02-17T01:05:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Subtlepseudonym](https://avatars.discourse-cdn.com/v4/letter/s/f4b2a3/32.png) [@Subtlepseudonym](https://forum.kirupa.com/u/Subtlepseudonym)\
**Post date:** [February 17, 2011, 1:05am UTC](https://forum.kirupa.com/t/having-some-menu-trouble/319342/1 "2011-02-17T01:05:30Z")

</div>

Having some trouble with a menu I wrote a little while ago. The buttons change colors when selected, though I’ve no idea how to change the frame to frame 2 when I click the button. this.gotoAndStop(2) doesn’t work because the code is in the object class for the menu Movieclip. What should I have use instead of ‘this’ to make the game jump to frame 2? The code from my menu object’s actionscript class is below:

package {  
import flash.display._;  
import flash.events._;  
import flash.text.\*;  
import flash.geom.ColorTransform;  
import flash.ui.Mouse;

public class MenuHandler extends MovieClip {  
//Variables  
private var button\_start:Object;  
private var button\_select:Object;  
private var button\_options:Object;

public function MenuHandler() {

button\_start = new Object();  
button\_start.mc = this.New\_Game.base;  
button\_select = new Object();  
button\_select.mc = this.Level\_Select.base;  
button\_options = new Object();  
button\_options.mc = this.Options.base;

this.addEventListener(Event.ENTER\_FRAME, onButton);  
this.New\_Game.addEventListener(MouseEven t.CLICK, newGame);  
//this.Level\_Select.addEventListener(Mou seEvent.CLICK, levelSelect);  
[//this.Options.addEventListener](https://this.Options.addEventListener)(MouseEve nt.CLICK, options);  
}

//Rolling over button  
public function onButton(event:Event) {  
var ct:ColorTransform = new ColorTransform();  
var rct:ColorTransform = new ColorTransform();

ct.color = 0xFFCC33;  
rct.color = 0x999999;

if(this.mouseX \>= 360 && this.mouseX \<=510 && this.mouseY \>= 150 && this.mouseY \<= 180) {  
button\_start.mc.transform.colorTransform = ct;  
}else {  
button\_start.mc.transform.colorTransform = rct;  
}  
if(this.mouseX \>= 360 && this.mouseX \<= 510 && this.mouseY \>= 180 && this.mouseY \<= 210) {  
button\_select.mc.transform.colorTransfor m = ct;  
}else {  
button\_select.mc.transform.colorTransfor m = rct;  
}  
if(this.mouseX \>= 360 && this.mouseX \<= 510 && this.mouseY \>= 210 && this.mouseY \<= 240) {  
button\_options.mc.transform.colorTransfo rm = ct;  
}else {  
button\_options.mc.transform.colorTransfo rm = rct;  
}  
}

public function newGame(event:MouseEvent) {  
this.gotoAndStop(2); //This is the part of the code I’m referring to above.  
//What should I replace ‘this’ with so that the game with go to frame 2?  
}  
}  
}
