0
\$\begingroup\$

Flash CS5 AS3 Is there a way to reset all the timelines while/if the Frame 1 en Scene 1 is called?

I happen to have lots symbols with timelines, if I gotoAndPlay Scene 1 frame 1, most symbols won't restart.

I use

MovieClip(root).gotoAndPlay("one");
\$\endgroup\$
1
  • \$\begingroup\$ What's with the "one"? Are you using timeline markers? If you want to go to frame one, then you should call gotoAndPlay(1). \$\endgroup\$
    – bummzack
    Commented Nov 23, 2011 at 8:14

1 Answer 1

1
\$\begingroup\$

If you have only one level of children, it's easy. You just loop through them and call gotoAndPlay like this:

for (var i:int = 0; i< MovieClip(root).numChildren; i++) 
{
    MovieClip(root).getChildAt(i).gotoAndPlay("one");
}

But if you have multiple levels of children, you should do a recursion through all children and run the code above for all of them.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .