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:19:40
ActionQueue method to rotate a movieclip over time.

Summary


Class properties
  • START_VALUE : Number
    • Start animation value to be returned to the perform function.
  • END_VALUE : Number
    • End animation value to be returned to the perform function.
  • CW : Number
    • Clockwise rotation.
  • CCW : Number
    • Counter-clockwise rotation.
  • NEAR : Number
    • Clockwise or counter-clockwise rotation to nearest rotation.
Class methods
  • rotate (inMC:MovieClip, inDuration:Number, inStartRotation:Number, inEndRotation:Number, inDirection:Number, inEffect:Function) : ActionQueuePerformData

Class properties

CCW

static CCW:Number = -1
(read)

Counter-clockwise rotation.

CW

static CW:Number = 1
(read)

Clockwise rotation.

END_VALUE

static private END_VALUE:Number = 0
(read)

End animation value to be returned to the perform function.

NEAR

static NEAR:Number = 0
(read)

Clockwise or counter-clockwise rotation to nearest rotation.

START_VALUE

static private START_VALUE:Number = 1
(read)

Start animation value to be returned to the perform function.

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 CW
inEffect :
(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.