How do I resume animation on mouse click?
I created a simple animation of water flowing through pipes and need it to pause at certain points then resume on a mouse click. How do I do that with actionscript 3.0?
I created a simple animation of water flowing through pipes and need it to pause at certain points then resume on a mouse click. How do I do that with actionscript 3.0?
Use the play() command in the event handler...
resumeBtn.addEventListener(MouseEvent.CLICK, resumeAnimation);
function resumeAnimation(evt:MouseEvent):void {
play();
}
If you do not have a button for this and just want to click anywhere try changing the event listener to...
stage.addEventListener(MouseEvent.CLICK, resumeAnimation);
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.