107 posts
  • Has been a member for 6-7 years
  • Sold between 100 and 1 000 dollars
the_asman says
A lot of times the flash tween class does not work 100% as expected especially when it is used in a loop. Anyone knows solution to get out of this?

it all depends on what issues you are having

but chances are most of your tween issues will be resolved if you declare the var myTween:Tween outside of the a function

in AS3 there is a property that lets you test if it is still tweening so a simple
if( myTween.isPlaying )
will also help you

691 posts
  • Bought between 10 and 49 items
  • Canada
  • Exclusive Author
  • Has been a member for 7-8 years
  • Sold between 5 000 and 10 000 dollars
geoken says
add your tweens in arrays so they won’t be deleted by the flash player garbage collector… or use tweener.

This is the best solution. Declaring them globally works, but unless you litter your code with a bunch of globally referenced tween instances that you may or may not use you can’t really use this method in a loops.

An array is the easiest way to get all the benefits of globally declared vars for objects that are created dynamically.

70 posts
  • Sold between 1 000 and 5 000 dollars
  • Has been a member for 5-6 years
  • Exclusive Author
  • Bought between 10 and 49 items
  • Referred between 1 and 9 users
  • United States
ryguy says

TweenLite is an elegant solution. I enjoy working with it.

The license allows you to use it in commercial projects and I definably recommend donating to the project. (you’ll get some bonus goodies!)