好的,所以我是一个完全的菜鸟。我想用任何键盘按钮在 as3 中推进一个场景。这是我的代码,你能帮我吗?
import flash.events.Event;
stage.addEventListener(MouseEvent.CLICK, startGame);
addEventListener(Event.ENTER_FRAME, asteroidMovement);
stage.addEventListener(KeyboardEvent.KEY_DOWN, startGameWithKeys);
stop();
function startGameWithKeys(e:KeyboardEvent){
removeEventListener(Event.ENTER_FRAME, asteroidMovement);
stage.removeEventListener(MouseEvent.CLICK, startGame);
gotoAndStop(1, "Scene 2");
}
function startGame(e:MouseEvent)
{
removeEventListener(Event.ENTER_FRAME, asteroidMovement);
stage.removeEventListener(MouseEvent.CLICK, startGame);
gotoAndStop(1, "Scene 2");
}