我在这里有一个特殊的情况,通常我对此没有任何问题。
情况是这样的,我有4个屏幕。游戏画面、菜单、胜利画面和死亡画面。
情况是允许我的播放器从获胜屏幕转到菜单的按钮不起作用。我跟踪它并且按钮正在工作,它只是不移动框架。
这是我使用的代码。
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");
}
我不知道该怎么办。
时间线: