Click, animate rotation of Object by +90° via AS3?
I have a button that will rotate an object in its parent by 90 degrees every time its clicked:
b_rotate_CW.addEventListener(MouseEvent.CLICK, rotateCW);
function rotateCW(event:MouseEvent):void
{
Object(this).parent.module.rotation += 90;
}
Which is fine, but I think it would be a nice touch if the object's rotation were animated.
I tried this:
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
b_rotate_CW.addEventListener(MouseEvent.CLICK, rotateCW);
function rotateCW(event:MouseEvent):void
{
var rCW:Tween = new Tween(Object(this).parent.module, "rotate", Strong.easeOut, 0, +90, .5, true);
}
... but it does nothing at all, I am guessing that "rotate" is a property option, I can find no documentation for that, only x, y, their scale and alpha.
I'm sure this has been done by many, can anyone offer a helpful clue as to how this function would be properly coded?
Thanks!
