flash noob cue
- Started
- Last post
- 8 Responses
- Mishga
Ok, i am ashamed...but i didn't found the answer anywhere..
i have a timeline with many movieclips, i have a play/pause button on the root..how do i stop all movieclips?
_root.stop(); only stop the main timeline not the movieclip timeline...
anyone?!?
Cheers!!=)
- lvl_130
you need to target each movieclip. ie. give each clip an instance name and tell it to stop
- lvl_130
clip1.stop();
clip2.stop();
etc.
- ornj0
could use a for...in loop to loop through all movieclips on the state and tell them all to stop. There should be example code in the flash help file.
- Mishga0
Thanks guys...
Cheers...=)
- fyoucher10
if you have a ton....use a for in loop like ornj said... check for typeof 'movieclip', get the MC name, then stop it...
Or if you want to be more specific about which ones you want to stop, use a for loop that loops thru an array.
var clipsToStop_array:Array = [clip1_mc, clip2_mc, clip3_mc];
for(var i:Number = 0;i<clipsToStop_array.length;i...
clipsToStop[i].stop();
}
- Seanbot0
Just setup a function so if you need to call it again for whatever reason - it will save you tons of time and a KB or two.
- ornj0
for(var name in _root) {
if (typeof(_root[name]) == "movieclip") {
_root[name].stop();
}
}Done.