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.

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

Resources;

thanks http://www.psyked.co.uk/actionscript/tweener-and-256-levels-of-recursion-were-exceeded-in-one-action-list.htm

Preloading External Images in Flash Using the MovieClipLoader Class

Preloading External Images in Flash Using the MovieClipLoader Class

The MovieClipLoader class is an ActionScript tool for loading external content such as images and Flash movies into another Flash movie. Other ways for doing this same thing is the Loader Component and the old .loadMovie() method. The MovieClipLoader class is better than those other two methods because of its flexibility and advanced options for tracking the progress of your downloaded objects. This tutorial will teach you the basics on how to use the MovieClipLoader class to load an external image in Flash at run time. You are assumed to have a beginner knowledge of ActionScript in order to follow this tutorial. Continue reading “Preloading External Images in Flash Using the MovieClipLoader Class”

AS2 tween – tweener how to intercept when the tween is finished

Sometimes, it is needed to know when the tween animation that we have applied to a MovieClip is finished.
This way, we can call other functions and carry out other codes in our Flash project.
To intercept the event that is initiated by Tweener at the end of the animation, we need to pass a parameter named onComplete to the method addTween the following way:

Code:
import caurina.transitions.Tweener;

Tweener.addTween(clip_mc,{x:500,time:1,transition:"easeOutBounce",onComplete:ItsDone});

Together with onComplete, I pass the name of the function that I want to be carried out at the end of the tween (in this case, I named it ItsDone).

Continue reading “AS2 tween – tweener how to intercept when the tween is finished”