Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

If statement to go to a frame

Community Beginner ,
Jun 21, 2013 Jun 21, 2013

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);

}

TOPICS
ActionScript
437
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jun 21, 2013 Jun 21, 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);

}

Translate
Community Expert ,
Jun 21, 2013 Jun 21, 2013

next_btn.addEventListener(MouseEvent.CLICK,nextF);

function nextF(e:MouseEvent):void{

audio_par1_mc.gotoAndStop(1);

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 21, 2013 Jun 21, 2013
LATEST

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);

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines