this is portable

basic tween with AS 3

I started using Flash’s native tween class a lot more the last few months and I was curious to see what changed in AS3 when it comes to  simple scripted tweens. The answer is, not much. The biggest differences are the path to import the class and your event Listeners.

Here’s a quick rundown of the differences:

Importing AS2:

import mx.transitions.Tween;
import mx.transitions.easing.*;

Importing AS3:


import fl.transitions.Tween;
import fl.transitions.easing.*;

Listening for onMotionFinished in AS2:
molTween.onMotionFinished = function() {
output_txt.text += “tween done”;
}

Listening for onMotionFinished ins AS3:


molTween.addEventListener(”motionFinish”, finishedTween);

function finishedTween(event:Event):void {
trace(”tween done”);
}

Check out the source files to see the full code in action.

it has been revived!

The blog is back. Its been a while as you can tell from the older posts that are left. 2007 seemed like a good time to start the blog up again. So here it is with a new design and plans for posting much more often.