AQRotate
| Kind of class: | class |
|---|---|
| Inherits from: | none |
| Author: | Arthur Clemens |
| Classpath: | org.asapframework.util.actionqueue.AQRotate |
| File last modified: | Thursday, 12 October 2006, 11:10:57 |
ActionQueue method to rotate a movieclip over time.
Class properties
CCW
static CCW:Number = -1
(read,write)
Counter-clockwise rotation.
CW
static CW:Number = 1
(read,write)
Clockwise rotation.
NEAR
static NEAR:Number = 0
(read,write)
Clockwise or counter-clockwise rotation to nearest rotation.
Class methods
rotate
static function rotate (
inMC:MovieClip,
inDuration:Number,
inStartRotation:Number,
inEndRotation:Number,
inDirection:Number,
inEffect:Function) : ActionQueuePerformData
Parameters:
inMC :
movieclip to rotate
inDuration :
length of rotation in seconds; 0 is used for perpetual animations - use -1 for instant rotation
inStartRotation:
the starting rotation in degrees; if null the current movieclip rotation will be used
inEndRotation :
the end rotation in degrees; if null the current movieclip rotation will be used
inDirection :
(optional) the rotation direction; either
AQRotate.CW (clockwise) or AQRotate.CCW (counter-clockwise) or AQRotate.NEAR (nearest rotation); default CWinEffect :
(optional) An effect function, for instance one of the mx.transitions.easing methods. Arguments to pass the effect function may be appended as a comma-separated list.
Returns:
A new ActionQueuePerformData object.
Example:
This example rotates a needle in a dial to the location that has been clicked, using the direction of the nearest rotation:
var angle:Number = NumberUtils.angle(_xmouse - needle_mc._x, _ymouse - needle_mc._y);
queue.addAction( AQRotate.rotate, needle_mc, 1, null, angle, AQRotate.NEAR );Usage note:
Bug: passing an inDuration of 0 will result in no rotation at all.