1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...

Tweener and “256 levels of recursion were exceeded in one action list”

Tweeners’ great, but I came across one little problem the other day: when I tried to remove an externally loaded swf from the stage while it was mid-animation, Tweener could bring the whole Flash movie to a halt with the error ’256 levels of recursion were exceeded in one action list’.

Obviously that’s bad – because this particular error completely stops the flash player with no warning to the end user.  And the fact that external content – which I have no control over – can cause this is doubly bad.

All is not lost however, because Tweener has a useful little function: Tweener.removeAllTweens(); ok, so it can interfere with everything on your flash movie as well, but at least it’s stopping the recursion errors.

So, if you try to remove a loaded swf file with .removeMovieClip(), you might find that it’s using Tweener.  And if so, call Tweener.removeAllTweens() before you call .removeMovieClip() and you’ll be fine.  Phew! case closed.

Resources;

5 Comments »

  1. There’s also good ol’ removeTweens()

    Tweener.removeTweens(target:Object [, property1:String, property2:String, ...]):Boolean;

    http://hosted.zeh.com.br/tweener/docs/en-us/

    Comment by lee — 13 October 2008 #

  2. Thanks for this – in my case Tweener caused this error to be thrown when calling a shift to another scene. Calling this before that action fixed it. I know I would have been pulling my hair out over this for hours ; )

    Comment by Fran — 23 October 2008 #

  3. Two days off hell at work, then I found this article :) thanx!

    Comment by Dave — 27 January 2009 #

  4. This does remove a all tweens, however, if an onComplete function is called, that function is still called at the end of the amount of time any tweens would have taken! How does one deal with that, as this will cause errors in some cases!

    Comment by dave — 16 October 2009 #

  5. Thank god I stumbled upon this!

    I had a similar problem to Fran where this would come up if I interrupted an animation with a button click mid flow.

    I had to call removeTween on each button but it works!

    Thanks so much James!

    Comment by ben — 10 December 2009 #

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Note: This post is over a year and a half old. You may want to check later in this blog to see if there is new information relevant to your comment.