Skip to main content
Participant
December 11, 2020
Question

How to use navigation in Adobe Animate?

  • December 11, 2020
  • 1 reply
  • 835 views

Hello everyone, having a bit of trouble on trying to have my buttons (next, back, and replay) work correctly. I have 11 frames aniamted, first frame works correctly and the next button takes it to the next frame. However, the next frame does not play my animation and that's where I am stuck right now. 

On my first frame I have this:

import flash.events.MouseEvent;

stop ();


var userName;

next_btn.addEventListener(MouseEvent.CLICK, getName);

function getName(event:MouseEvent):void
{
trace("button works");
nextFrame();
}

 Which works for me so far. Does anyone have any tips on how I can have my other frames animate and then have my buttons (next and back) work for my next 10 frames? 

 

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
December 12, 2020

nextFrame() and prevFrame() are gotoAndStop() shortcuts.  if you want to play a frame animation (where the frames are on the same timeline as the code. you'll need to use gotoAndPlay().  eg,

 

gotoAndPlay(this.currentFrame+1);

 

and it's more complicated for playing a previous animation.

 

it's simpler to put your animations in movieclips, put those moviclips on the main timeline and then use nextFrame() and prevFrame() on the main timeline.