http://www.unfocus.com/2009/12/07/stop-all-child-movieclips-in-flash-with-actionscript-3-0/

[as3]
//
import flash.display.DisplayObjectContainer;
import flash.display.MovieClip;

function stopAll(content:DisplayObjectContainer):void
{
if (content is MovieClip)
(content as MovieClip).stop();

if (content.numChildren)
{
var child:DisplayObjectContainer;
for (var i:int, n:int = content.numChildren; i < n; ++i)
{
if (content.getChildAt(i) is DisplayObjectContainer)
{
child = content.getChildAt(i) as DisplayObjectContainer;

if (child.numChildren)
stopAll(child);
else if (child is MovieClip)
(child as MovieClip).stop();
}
}
}
}
//
[/as3]

Leave a Reply

Your email address will not be published. Required fields are marked *

Post Navigation