Skip to main content
Participant
September 26, 2021
Question

Action Script Buttons

  • September 26, 2021
  • 1 reply
  • 270 views

So I'm trying to script a next button to go from a frame which I stopped using "stop();" to play another movie clip before it goes onto the next stage (which worked fine) however I used the code snippet "Click to go to frame and play" and put "691" which is the next frame I want it to go to when I click the Next Button but for some reason nothing happens when i preview and click it. All the previous times in this same project where I've created a next button it worked but not sure why for this part it isn't working.

 

Can someone help? I can send you the file if you need but I just need this to work.

 

Here is the code I put in frame 690 which is where I stopped it.

 

stop();


// Play a Movie Clip
mccroppedearth.play();

 

// Click to Go to Frame and Play

next_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_3);

function fl_ClickToGoToAndPlayFromFrame_3(event:MouseEvent):void
{
gotoAndPlay(691);
}

 

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
September 26, 2021

first, is there an error message?

 

if not, use the trace function to debug.  eg, 

 

stop();


// Play a Movie Clip
mccroppedearth.play();

 

trace(next_btn,next_btn.x,next_btn.y);

 

// Click to Go to Frame and Play

next_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_3);

function fl_ClickToGoToAndPlayFromFrame_3(event:MouseEvent):void
{

trace("clicked");
gotoAndPlay(691);
}

Participant
September 27, 2021

@kglad No there isn't an error message but nothing happens when the button is clicked.

And I tried your trace code however it still doesn't work. Would you like me to attatch the file so you can have a look?

kglad
Community Expert
Community Expert
September 27, 2021

what's in the output panel when using the code i suggested?