all groups > flash actionscript > october 2004 >
You're in the

flash actionscript

group:

Stop Action


Stop Action DOC7-12
10/31/2004 11:32:23 PM
flash actionscript:
Re: Stop Action kglad
11/1/2004 12:11:35 AM
if you want to stop a particular movieclip you must reference that movieclip by
path/instance name. if you want to stop them, attached to your button you can
use:

on(press){
stopAllMovies(_root);
}

and attached to a frame:

function stopAllMovies(mc){
mc.stop();
for(obj in mc){
if(typeof(mc[obj])=="movieclip"){
stopAllMovies(mc[obj]);
}
}
}
Re: Stop Action DOC7-12
11/1/2004 12:29:44 AM
Thanks for your reply. I'll give it a shot. I'm assuming that the first
actionscript you mentioned will stop any movie clip that might be playing. The
second one seems a bit beyond my grasp at the moment. Appreciate the help. Doc
Re: Stop Action kglad
11/1/2004 4:16:19 AM
the two bits of code accomplish one thing: to stop all movieclips. the first
snipet is attached to a button and the 2nd to a frame, but they work together
with the button handler invoking the function defined in the 2nd snipet.
Re: Stop Action DOC7-12
11/2/2004 4:44:22 PM
The button the 1st snippet is attached to is on screen throughout all the
frames and can be activated ata any time. Which frame do I attach the second
snippet to? Do I put it on a frame at the end of the movie with a label and
direct the button click to that particular frame?
Re: Stop Action kglad
11/3/2004 2:48:05 PM
no, the 2nd snippet needs to be in a frame that is played NO LATER than when
the button might be first pressed. generally, you would put that code on frame
1 on the timeline that contains the button (which is probably the _root
timeline).
AddThis Social Bookmark Button