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 {;

About Host Media

We have been hosting websites since 2002 and are always moving forward. All articles written under the Host Media author are created by the team who support our customers.


Flash ActionScript {AS}


, ,