Actionscript Code:
import com.darronschall.DynamicRegistration;
import mx.transitions.Tween;// Import tween class
import mx.transitions.easing.*;// Import easing class
// Assume there is an instance named square_mc on the stage
var square_mc:MovieClip;
DynamicRegistration.initialize(square_mc);
// set up initial registration point
var centerX = square_mc._width / 2;
var centerY = square_mc._height / 2;
square_mc.setRegistration(centerX,centerY);
var rotateMe = 90;
my_butt.onRelease = function() {
my_butt.enabled = false;
var thisTween:Tween = new Tween(square_mc, "_rotation2", Regular.easeOut, square_mc._rotation2, rotateMe, 1, true);
thisTween.onMotionFinished = function() {
delete this;
rotateMe += 90;
if(rotateMe > 270) {
rotateMe = 0;
}
trace("rotateMe = " + rotateMe);
my_butt.enabled = true;
};
};