Posted By

Syllogism on 02/22/11


Tagged

recursive function to all stop movieclips


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

merritt212
jondiscipulo
hejaaa
lordsirc


stop all movieclips inside a movieclip


 / Published in: ActionScript 3
 

originally from http://www.actionscript.org/forums/archive/index.php3/t-169221.html

  1. function toggleMovieClip($mc:MovieClip, $state:String):void
  2. {
  3. ($state == "play") ? $mc.play() : $mc.stop();
  4. for (var i:int = 0; i < $mc.numChildren; i++)
  5. {
  6. if ($mc.getChildAt(i) is MovieClip) toggleMovieClip(MovieClip($mc.getChildAt(i)), $state);
  7. }
  8. }

Report this snippet  

You need to login to post a comment.