I have a perculiar situation here, usually I have no problems with this.
The situation is like this, I have 4 screens. A game screen, a menu and a win screen and a death screen.
the situation is that the buttons that allow my player to go from the win screen to the menu is not working. I traced it and the button is working, it just doesn't move the frames.
here are the codes I used.
public function prototype() {
}
public function startMenu() {
btnStart.addEventListener(MouseEvent.CLICK, gotoGame);
}
public function gotoGame(evt: MouseEvent): void {
btnStart.removeEventListener(MouseEvent.CLICK, gotoGame);
gotoAndStop("game1");
}
public function gotoGameA(evt: MouseEvent): void {
btnContinue.removeEventListener(MouseEvent.CLICK, gotoGameA);
btnMenu.removeEventListener(MouseEvent.CLICK, gotoFront);
gotoAndStop("game1");
}
public function gotoWin() {
gotoAndStop("win");
startWin()
}
public function startWin() {
btnContinue.addEventListener(MouseEvent.CLICK, gotoGameA);
btnMenu.addEventListener(MouseEvent.CLICK, gotoFront);
}
public function gotoFront(evt: MouseEvent): void {
trace("please work")
gotoAndStop("menu");
startMenu();
}
public function gotoDeath() {
gotoAndPlay("death");
}
I am not sure what to do with this.
Timeline: