Skip to main content
WEW
Participant
November 7, 2014
Answered

control stage frame from button function

  • November 7, 2014
  • 1 reply
  • 189 views

when i press the button

it does the trace but ignore the gotoAndPlay

did i miss anything?

package

{

  import flash.display.MovieClip;

  import flash.events.MouseEvent;

  public class Main extends MovieClip

  {

  public function Main()

  {

  playgame_btn.addEventListener(MouseEvent.CLICK, playgame);

  readme_btn.addEventListener(MouseEvent.CLICK, pressread);

  }

  function playgame(event:MouseEvent):void

  {

  trace("PLAY has been clicked.");

  gotoAndStop(140);

  }

  function pressread(event:MouseEvent):void

  {

  trace("SHOW has been clicked.");

  gotoAndStop(140);

  }

  }

}

This topic has been closed for replies.
Correct answer Ned Murphy

Since there is no gotoAndPlay() command in the code, I will assume you mean the gotoAndStop() commands.   The code appears fine.  You should place a trace in frame 140 to check to see if it gets there but you do not see it.

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
November 7, 2014

Since there is no gotoAndPlay() command in the code, I will assume you mean the gotoAndStop() commands.   The code appears fine.  You should place a trace in frame 140 to check to see if it gets there but you do not see it.