1

I am making a simple animation made up of 5 looping scenes. I want to use certain keyboardEvents to procede to the next scene. So far I have put the following code in Scene 2;

stage.addEventListener(KeyboardEvent.KEY_DOWN, plutofl_KeyboardDownHandler);

function plutofl_KeyboardDownHandler(event:KeyboardEvent):void {
  if(event.keyCode == Keyboard.Q) {
    gotoAndPlay(1, "Scene 3"); 
  }   else if (event.keyCode == Keyboard.W) {
    gotoAndPlay(1, "Scene 1"); 
  }
}

The animation advances up scenes fine but to go back it inherits the action from the scene it has just left and gets stuck. Is there a simple way to keep the action script for only the current scene?

mrGabes
  • 11
  • 1

0 Answers0