Scripting a button to stop & start a MC timeline

I am having a bit of trouble figuring out what to do in my situation.
I am a main timeline, with a movie clip that I want to loop infinitly, until a button is clicked, once the button is clicked I want it to stop the movie clip timeline, once the button is clicked again I want it to start the movie clip timeline again.

I am not the greatest actionscripter, I understand it I just have a bit of trouble writing the syntax myself.

Any help is greatly appreciated.

Lawrence

I’m sure there are lotsa other ways to do it but:

actions for the button:

on(release) {
if(!_root.stopmc) {
<b>yourmc</b>.stop();
_root.stopmc = true
} else {
<b>yourmc</b>.play();
_root.stopmc = false
}
}

change “yourmc” to the instance name of the mc you want to stop/play!
It checks if a variable is true or false, if it’s false then it stops the mc and makes the variable true, if it’s true then it starts playing it and sets it to false.

this is not working for me

on(release) {
if(!_root.stopmc) {
juggler.stop();
_root.stopmc = true
} else {
yourmc.play();
_root.stopmc = false
}
}

“juggler” being the name of the movie clip instance

change the second “yourmc” too! but maybe that’s just a typo now!
try _root.jugger (if the mc is on the main timeline)