Copy link to clipboard
Copied
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);
}
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);
}
Copy link to clipboard
Copied
next_btn.addEventListener(MouseEvent.CLICK,nextF);
function nextF(e:MouseEvent):void{
audio_par1_mc.gotoAndStop(1);
}
Copy link to clipboard
Copied
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);
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now