Skip to main content
Participant
July 14, 2021
Question

Need help creating play, pause, reverse, forward button functionality

  • July 14, 2021
  • 2 replies
  • 882 views

My knowledge of Adobe Animate CC and CreateJS is basic (no prior Flash experience) so I need help with this. I am essentially trying to create movie controls on this animation:

http://evolution-dev.berkeley.edu/flashconversion/treeRoom/fieldguide-tree-square-anim-controls.html

 

There's nothing fancy about the animation, just forward movement of the timeline.

 

The play button:

_this.btnSmPlay.on('click', function(){
_this.gotoAndPlay(1);
});

 

The pause button:

_this.btnPause.on('click', function(){
_this.stop();
});

 

I found the script for the forward and reverse buttons on this forum here: https://community.adobe.com/t5/animate/play-in-reverse-in-animate-htlm-canvas-for-a-360/m-p/10828021

 

Problems:

  • How do I get the play button to continue playing from the frame number that it has stopped on and not to go to frame 1 which is what I have it currently doing? 
  • Reverse and forward buttons also don't work once the animation is paused.

 

Thanks for any help!

    This topic has been closed for replies.

    2 replies

    Trish5ED0Author
    Participant
    July 14, 2021

    Following up on this post: the scripts for the reverse and forward buttons conflict with my menu scripts so I've removed them (it's the same script I link to above). 

     

    I would love assistance with figuring out how to have the timeline move backwards from where it's paused. I think I'll just use .play() to move forward. 

     

    Thanks in advance!

    Legend
    July 14, 2021

    So you want some way to goto a previous point on the timeline and play it from there?

    Trish5ED0Author
    Participant
    July 14, 2021

    No, I want the timeline to move backwards in reverse, from the point where it has stopped. I know there's no .reverse() function (it would be nice to have) but I literally want the timeline to move backwards. (Just like moving the timeline from right to left.)

    Legend
    July 14, 2021

    "How do I get the play button to continue playing from the frame number that it has stopped on and not to go to frame 1 which is what I have it currently doing?"

     

    Is there some reason you can't just use .play()?

    Trish5ED0Author
    Participant
    July 14, 2021

    LOL, thanks! I didn't even think of that. I use the wizard and that option never popped up. Yes, that works, thanks!

     

    I'm realizing that the scripts for the forward and reverse buttons conflict with my other scripts (namely the menu buttons) so I commented them out. Would love some help on that. I'm going to edit my original post to reflect that.