How to stop and resume the animations of nested movieclips
Hi
I have many nested movieclips in different positions of the main timeline.
I have 2 buttons, play_btn and pause_btn.
I'd like when the user click pause_btn, the animations on the main timeline and in nested movieclips stop.
Whe he click play_btn the animations resume in both the main timeline and nested movieclips.
I have created array of nested movieclips on the main timeline.
var arr:Array = new Array(mc1, mc2, mc3, mc4, mc5);
play_btn.addEventListener(MouseEvent.CLICK, on_play_btn);
pause_btn.addEventListener(MouseEvent.CLICK, on_pause_btn);
function on_play_btn(e:MouseEvent):void
{
gotoAndPlay(currentFrame);
for(var i:Number = 0; i < arr.length; i++)
{
if(arr != null)
{
arr.play();
}
}
}
function on_pause_btn(e:MouseEvent):void
{
gotoAndStop(currentFrame);
for(var k:Number = 0; k < arr.length; k++)
{
if(arr
{
arr
}
}
}
but it only stops the animations on the main timeline and dosen't stop the animations in the nested movieclips.
Help me Please.
