Directional Blur + Tweener in AS3
May 24, 2008 — flaimHello,
What is it?
Click here to see it… - click the background to execute the movement.
How it works?
User executes tweener for movement. Then the distance (between last update and current object position) and angle (directional vector of the movement) are calculated in each tweener update - so are the blur amounts - basing on previous object coordinates (from the previous update) - then the blur is appled to the object and current coordinates become the previous one so the whole thing can start again on next tweener update
I assume this is not the best method for this effect (senocular did this better using bitmaps in as2- but this method is slow and needs rewriting for simple usage. There could also be transparency issues with bitmapdata there). Anyways it looks far better than mine (the object leaves the trail and is not just blurred like in my method) but the method here works without the bitmapData and sports Tweener
The source?
Sure! You can download it here
Quick Q&A:
Q: Can it be used with papervision in 3d?
A: Yep… you have to introduce Z to the equations and change the distance calculating function for one that would calculate it in three dimensions.
Q: Can I use it with multiple objects?
A: Yes you can! You can execute as many instances you want (and flash can handle;)) It uses the object reference so it can run many times on different objects simultanously.
Have Fun!
FLAIM







