Add play/pause/play button to control movie clip playback
I'm using Animate CC, ActionScript 3.0.
I've got a movie clip on the main time line and a play button. When the file is exported to a .SWF file the play button works fine to play the movie clip. However, I need to add a play/pause/play function. The play button should perform as follows:
Click play button once = plays the movie clip
Click same button = pauses the movie clip.
Click same button = resumes play of the movie clip from the point it was stopped (not from the beginning).
Here's the AS on the main time line, movie clip name is "TimeElapse":
TimeElapse.stop();
function startTimeElapse(event:MouseEvent):void
{
TimeElapse.play();
}
startButton1.addEventListener(MouseEvent.CLICK, startTimeElapse);
Inside the movie clip on the last frame I have AS: stop();
I am happy to upload the file if needed, I have a very simple sample file I'm playing around with to try to get the play/pause/play function to work. Any assistance is greatly appreciated!
