Skip to main content
Participant
June 22, 2013
Answered

If statement to go to a frame

  • June 22, 2013
  • 2 replies
  • 460 views

it has been a while since i have been in Flash and I am trying to make an if statment for a button called "next_btn" i am sure i am doing the code wrong, but i want a movie clip called "audio_par1_mc" to go to frame one if the user clicks on the button what would be the code to make "audio_par1_mc" go to frame one if the button is clicked?

would it be something like this?

if (next_btn.CLICK) {

     audio_par1_mc.gotoAndStop(1);

}

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

In AS3 just about everything that happens or can happen revolves around the use of event listeners and event handler functions for those listeners...

next_btn.addEventListener(MouseEvent.CLICK, nextClicked);

function nextClicked(evt:MouseEvent):void {

     audio_par1_mc.gotoAndStop(1);

}

2 replies

Ned Murphy
Ned MurphyCorrect answer
Legend
June 22, 2013

In AS3 just about everything that happens or can happen revolves around the use of event listeners and event handler functions for those listeners...

next_btn.addEventListener(MouseEvent.CLICK, nextClicked);

function nextClicked(evt:MouseEvent):void {

     audio_par1_mc.gotoAndStop(1);

}

kglad
Community Expert
Community Expert
June 22, 2013

next_btn.addEventListener(MouseEvent.CLICK,nextF);

function nextF(e:MouseEvent):void{

audio_par1_mc.gotoAndStop(1);

}