Thursday, April 23, 2009

Flash AS3 Tweening

// Importing classes from fl package must be done explicitly
import fl.transitions.Tween;
import fl.transitions.easing.*;

// Declare variables for the tween movement. These could just as easily be local below.
var moveBackX:Tween;
var moveBackY:Tween;
var moveRound:Tween;

moveBackX = new Tween(dragger, "x", Strong.easeOut, dragger.x, holder.x, 0.5, true);
moveBackY = new Tween(dragger, "y", Strong.easeOut, dragger.y, holder.y, 0.5, true);
moveRound = new Tween(dragger, "rotation", Strong.easeIn, 0, 180, 0.5, true);

No comments: