Play/Pause Rollover Button

I’m looking to create a button that when clicked will pause the flash movie and when clicked again will continue playing. If possible, I would also like to be able to swap the images when clicked. So, for example, when the movie is playing there would be a button that says “pause”. When the button is clicked, the movie would pause and the button would switch to one that says “resume play”. Then when that button is clicked, the movie would play and the button would switch back to “pause”.

Is there any way to do this? I’ve done it a lot in Director, but can’t seem to get it to work in Flash. Please help!!!

Search is a powerful tool. This simple code might just do it:
on(release){
_root.my_mc.stop();
}

OK, here’s the best way to do this:

Make two different buttons: a pause button and a play button. Then make a new MovieClip. Put two keyframes at the beginning of that clip, and put this code in each one:

stop();

Put your pause button in the first frame. Click on it, and put in this code:

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

Put your play button in the second frame. Click on it, and put in this code:

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

That’s it. So how does this work? First, when you click on the pause button, it makes the MovieClip above it stop playing, and then it tells this MovieClip to go to frame 2, which has the play button in it. When you click on that, it tells the _parent MovieClip to start playing again, and sends this MovieClip back to frame 1, which has the pause button.

Hope this helps.