Skip to main content
Inspiring
August 27, 2006
Question

Stopping all movie clips at once, then play..

  • August 27, 2006
  • 1 reply
  • 297 views
Dear Everyone

I have one SWF that contains many movie clips, all accessed from '_root'.

I am using the following to stop (script on a 'stop' button) all the movie clips and the main time line:

on (press) {

function stopAllF(mc) {
mc = eval(mc);
for (obj in mc) {
if (typeof (mc[obj]) == "movieclip") {
mc[obj].stop();
stopAllF(mc[obj]);
}
}
}

yourLevels = new Array("_level0");
for (ivar=0; ivar<=yourLevels.length; ivar++) {
stopAllF(yourLevels[ivar]);
}

}

What I need to know is how to tell which movie clips were playing, when I pressed the stop button, because I will only want to start these movies when I press the play button.

It is no good just duplicating the script above and replacing stop() with play(), because that will play all the movies clip and main timeline. I only want to start the movie clips that were playing at the time I pressed the stopped button.

I need to find a property that identifies whether a movie clip is playing or not, but I cannot find anything like this in the actionscript reference...

I hope this makes sense.

Thanks

Charlie

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
August 27, 2006
you'll need to create that function (that returns all playing movieclips). the following should work: