AQCurve
| Kind of class: | class |
|---|---|
| Inherits from: | none |
| Author: | Arthur Clemens |
| Classpath: | org.asapframework.util.actionqueue.AQCurve |
| File last modified: | Thursday, 09 November 2006, 10:57:18 |
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.
Class methods
- moveCubicBezier (inMC:MovieClip, inDuration:Number, inStartX:Number, inStartY:Number, inEndX:Number, inEndY:Number, inControlPoint1:Point, inEffect:Function) : ActionQueuePerformData
- Moves a movieclip over a cubic bezier curve, defined by the start and end positions and 2 control points.
Class properties
END_VALUE
static private END_VALUE:Number = 0
(read)
End animation value to be returned to the perform function.
START_VALUE
static private START_VALUE:Number = 1
(read)
Start animation value to be returned to the perform function.
Class methods
moveCubicBezier
static function moveCubicBezier (
inMC:MovieClip,
inDuration:Number,
inStartX:Number,
inStartY:Number,
inEndX:Number,
inEndY:Number,
inControlPoint1:Point,
inControlPoint2:Point,
inEffect:Function) : ActionQueuePerformData
Moves a movieclip over a cubic bezier curve, defined by the start and end positions and 2 control points.
Parameters:
inMC :
movieclip to move
inDuration :
length of movement in seconds; 0 is used for perpetual animations - use -1 for instant change
inStartX :
x value to start moving from; if null then inMC's current _x value is used
inStartY :
y value to start moving from; if null then inMC's current _y value is used
inEndX :
x value to start moving to; if null then inMC's current (dynamic) _x value is used
inEndY :
y value to start moving to; if null then inMC's current (dynamic) _y value is used
inControlPoint1:
the first control point on the Bezier curve
inControlPoint2:
the second control point on the Bezier curve
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.
See Wikipedia on Cubic Bezier curves
Example:
- The following example moves a movieclip along a cubic bezier path during 4 seconds, from position (0,0) to (300,300). The path is defined by 2 control points. The animation has an easing effect.
queue.addAction( AQCurve.moveCubicBezier, my_mc, 4, 0, 0, 300, 300, new Point(100,400), new Point(400,100), Strong.easeOut );