Copy link to clipboard
Copied
I am trying to make some basic buttons to control animation/timelines.
All I need is a play button, pause button and replay button.
I would like all the code to be on the first frame of the main timeline. So far this is all I have...
this.stop();
this.ani.stop();
this.playBtn.addEventListener("click", fl_MouseClickHandler.bind(this));
function fl_MouseClickHandler() {
this.ani.play();
}
The names of the objects are...
I have the file setup as such...
All the animation is in one movie clip that is on the third layer. If possible I would like to tell the animation to stop playing from the root timeline, when it gets to the last frame, not by putting a stop in the movie clip of the animation. I want to control everything from the code in the root timeline if possible.
Any help would be much appreciated. 😃
ps... I tried to upload my .fla but everytime I try to post I get an error saying my file's content doesn't match its extention.
Copy link to clipboard
Copied
does your code work to play what you want?
Copy link to clipboard
Copied
Right now clicking the play button will play the targeted movie clip.
Copy link to clipboard
Copied
pause:
this.pauseBtn.addEventListener("click", pauseF.bind(this));
function pauseF() {
this.ani.stop();
}
replay:
this.replayBtn.addEventListener("click", replayF.bind(this));
function replayF() {
this.ani.gotoAndPlay(0);
}