PDA

View Full Version : pause button


Fergy
03-01-2003, 03:27 PM
I want a to create a button that will simply stop a movie when pressed, and when pressed again, it will continue to play the movie

Ricod
03-01-2003, 03:56 PM
To pause a movie : _root.myMovie.stop();
To play a movie : _root.myMovie.play();
to use the same button, use a variable :

on (release) {
if (_root.myMoviePlaying == "yes") {
_root.myMovie.stop();
_root.myMoviePlaying == "no";
}else{
_root.myMovie.play();
_root.myMoviePlaying == "yes";
}
}
ofcourse, replace all paths with their appropriate instance names. To make it clearer for the user, you could put this code on a invisible button, place a mc with different graphics under it and tell the graphics mc to go to the needed frame, just like you set the variable to either yes or no.

javen
03-03-2003, 01:38 AM
oh god ... this thread gave me all the answer that I needed. So happy .. that's wat forum does. ;)

Ricod
03-03-2003, 02:23 AM
Well, looks like someone finds it usefull :) ! Yeah, I'm learning a lot in this place too !

Fergy
03-05-2003, 10:01 AM
thanks for the script, but i've never used action scripts before and i cant get it to work. do i have to change mymovieplaying and my movie to something, and have i to declare them earlier or something?

Ricod
03-05-2003, 04:23 PM
myMovie is the name I used as a replacement. You need to replace it with the name of the mc you want to pause / resume. If you labeled it "somethingElse" and its on the main timeline, then the path to it would be _root.somethingElse .

Here' read thise tutorials on instance names and paths. It explains everything in greater detail :
Tutorial 02 : Instance Names (http://www.actionscript.org/tutorials/beginner/instances/index.shtml)
Tutorial 03 : Paths to Objects and Variables (http://www.actionscript.org/tutorials/beginner/paths/index.shtml)
All tutorials. (http://www.actionscript.org/tutorials.shtml)

Earlier ? You have to declare them when you want to execute them.