Flash Movie Controls – Play/Pause Button

I’m not very experienced in Flash. I can do basic movies with tweens, some playback buttons and maybe one or two animations, but that’s pretty much it. For a recent project however, I had to do a pause button.

Now this might seem like an easy task, but it isnt. A pause button must both pause and play the video. I looked around the web for some easy solutions, but couldn’t come up with anything useful (although I’m sure there are guides for it out there, I just didn’t look hard enough..). This is what I came up with:

How to create a Play/Pause button in Flash

  1. Create a movieclip called “playpause”. Put this movieclip anywhere in your main movie.
  2. Create a button in this movieclips first frame, call this button “pause”.
  3. Now go to frame two, create a keyframe and another button, call this one “play”.
  4. Create another layer, call this layer “script”. Put the marker in the first frame and open Frame Actions. Type in “stop();”. Create another keyframe, and do the same thing again.
  5. The buttons need some actionscripting too to be able to work. They need to both make the other button display and to play and pause our movie, which is the main target. I found a way to do this really easily. Click the button “pause”, and open Button Actions. Then type in:

on (release) {
gotoAndStop(2);
_parent.stop();
}

The first line displays the play button, the other one pauses the main movie. Select the other button, “play”, and type in:

on (release) {
gotoAndStop(1);
_parent.play();
}

Save the document, press Command+Enter (PC: CTRL+Enter) and make sure it works.

I hope you found the guide useful! Please leave a comment below and let me know what you thought.

74 comments

  1. wait, im confused. how do i make a button in the movieclip?button controls? im nt sure what to do. i have a video from my computer that i want to put on my webpage, and it plays, but has no pause or play button. am i at the right place?

  2. This worked perfectly, for once I stumble upon a tutorial where the person actually helps, thankyou!

  3. Hi,

    Thanks so much for posting this script.
    its saved me so much time.
    Does anyone know how to pause an swf which includes animated movieclips and sound also?

    Would be really helpful as i’m stuck?!

  4. I would like to say a massive THANK YOU for this page. It has really helped.

    On our staff intranet, we had a rotating banner, and I had two buttons which allowed you to flick between the next and previous banner. However people kept asking for a pause button, and because of this page, I have now successfully created a pause and play button on my banner which works successfully.

    Thank you so so much 🙂

  5. thank you for the awesome tutorials. but i have a problem here. this code works only for my movie not my sounds. i mean, the movie does ‘pause’ and ‘play’ but my sounds doesnt ‘pause’ when my movie pause -..-‘ can you help me pleaseee!

  6. i have some trouble with it. ma errors:

    Symbol ‘playpause’, Layer ‘Layer 1’, Frame 2, Line 3 1120: Access of undefined property _parent.

    Symbol ‘playpause’, Layer ‘Layer 1’, Frame 1, Line 1 1120: Access of undefined property release.

    Symbol ‘playpause’, Layer ‘Layer 1’, Frame 2, Line 3 1120: Access of undefined property _parent.

Leave a Reply to Melo Cancel reply

Your email address will not be published. Required fields are marked *