Flash Lite Tweening
When creating a mobile application using flash lite it can be very cool to tween objects around and create a cool interactive interface. But when using tweens you will immediately face the performance issues when animating clips on the stage. It can be fighting a brick wall sometimes to get the animation run smooth. Last week Luca Mezzalira posted an interesting trick on adobe’s mobile and devices cookbook. He pointed out some things you can consider in order to optimize your animation. Some of them you already knew yourself: do not animate too many object together, it slows down the performance heavily, avoid alpha animation etc.
But there were 2 tips that really got my attention.
– TweenLite is a good library to use for mobile animations
I have not done much detailed research but I always use greensock’s tweenlite (as2) engine in my Flash Lite projects because they seem to tween smoother en perform better. I compared it once with Tweener and on my n81 it seemed like basic animation performance was practically the same but when using bigger objects and alpha animation tweenlite performed better. Anyone ever experimented with these engines? Feel free to share your results, i’m only saying what I seemed to notice on my n81 device.
– When you move a movieclip that contains lots of textfields or clips, switch movie quality to low (fscommand2(“SetQuality”, “low”)) and, when animation is finish turn quality to high (fscommand2(“SetQuality”, “high”)).
This is a really simple but very efficient tip and has a great effect on your performance. You can download a test file at Luca’s blog.
I agree with Luca saying:
In fact I tried to use always high qualit and performance was not good, when I tried to set low quality before a Tween and switch to high when it finished, performance grown until to 50% instead of first method.
If you ever compared tween engines or did research on how to optimize tweens feel free to share it!