Lately I had been working on flash websites that require a user to pause a movie on what ever frame it is on then continue on another press of a button.

So I thought I would post this code as it has come in handy on all my projects for major websites:

This code goes on the start on the movie clip or root
The buttons instance is called ‘actionBtn’ on line 2 of the AS you will see this

var theCase:String = “doPlay”;
actionBtn.onRelease = function() {
if (_level0.theCase == “doPlay”) {
_level0.theCase = “doPause”;
} else {
_level0.theCase = “doPlay”;
this.onEnterFrame = function() {
if (_level0.theCase == “doPause”) {
} else {;

Join the conversation! 5,768 Comments