In this quick post I’d like to share with you my experience about Tween on Flash Platform projects delivered on a mobile devices.
I started work on mobile since Flash Lite 1.1 so I grew up with mobile, I lived all the Flash mobile evolution and now, on tablet and smartphone, I had some good tricks to share with you, I really hope that those tips could help you during your developer life.
OK, let’s start:
- Use quality property of stage
This is a really good technique to use when you have to improve performance of your project, when you need to make a fluid tween before launch it, set stage quality to low and when tween will finish set stage quality to high or best.
Avoid to use this technique when you have vectors (textfield for example) on the stage because you could have a worst result.
- Use cacheAsBitmap and cacheAsBitmapMatrix
If you have vector object that you’d like to animate in your project remember to cache them and then animate; remember also to set your application with GPU acceleration and you can see a really good performance with this technique.
Avoid to cache objects that you need to remove from display list, it will be so expensive for your memory.
- System.gc() works!
I tried in few sample to use it on Android and I saw a good result, so the “old” tip to call System.gc() twice in a try/catch statement works on mobile device too (only on AIR apps)
- Take care with multiple animations on iPad and iPhone
On iOS devices we don’t have AIR runtime so LLVM translate our AIR project for us in Native Binary so it could help if you move few objects per time in particular if you have big objects to move like a background or something like that
- Greensocks tweens are the best
I tried tweener and other tween libraries for AS3, but the best one for me are the Greensock tween library, in particular on iOS devices.
- Last but not least, remember to test your animation on the device because you could see “funny” results
Sometimes happen that on your computer everything works well but when you port your content on a tablet or smartphone everything works not so well.
Before hurt your head, remember to test a lots of times your mobile content on the device, it could save your projects!
That’s all folks for now, I hope you enjoy those tips.