eliashickman
March 7th, 2010, 09:49 AM
Pausing an animation with a setTimeout function controlling timeline movement.
Hello, everyone.
That's the title above.
I am working on creating a very large movie with multiple mp3s embedded in it and tons of text in between.
Right not I have some labeled frames, such as "The Big Toe" and "Old Woman" and on the "actions" layer directly above my "frame labels" layer I have code that looks like this.
setTimeout(gotoAndStop, 9000, 9);
setTimeout(gotoAndStop, 27500, 10);
setTimeout(gotoAndStop, 41000, 11);
setTimeout(gotoAndStop, 58500, 12);
setTimeout(gotoAndStop, 62000, "TOC");
Where TOC is Table Of Contents.
What the setTimeout functions do is move the playhead along as the audiobook MP3 is being read with the text I've pasted in a text field on the stage.
I would like to use some movieClips that I have instantiated on the stage "pauseBtn", "playBtn", and "stopBtn" to control the timeline.
Is there a way to "catch" the setTimeout function exactly when the button is clicked and then pause the audio and playhead??
Thanks again to everyone that helped me in the last project by the way.
Hello, everyone.
That's the title above.
I am working on creating a very large movie with multiple mp3s embedded in it and tons of text in between.
Right not I have some labeled frames, such as "The Big Toe" and "Old Woman" and on the "actions" layer directly above my "frame labels" layer I have code that looks like this.
setTimeout(gotoAndStop, 9000, 9);
setTimeout(gotoAndStop, 27500, 10);
setTimeout(gotoAndStop, 41000, 11);
setTimeout(gotoAndStop, 58500, 12);
setTimeout(gotoAndStop, 62000, "TOC");
Where TOC is Table Of Contents.
What the setTimeout functions do is move the playhead along as the audiobook MP3 is being read with the text I've pasted in a text field on the stage.
I would like to use some movieClips that I have instantiated on the stage "pauseBtn", "playBtn", and "stopBtn" to control the timeline.
Is there a way to "catch" the setTimeout function exactly when the button is clicked and then pause the audio and playhead??
Thanks again to everyone that helped me in the last project by the way.