ActionQueuePerformData
| Kind of class: | class |
|---|---|
| Inherits from: | none |
| Author: | Arthur Clemens |
| Classpath: | org.asapframework.util.actionqueue.ActionQueuePerformData |
| File last modified: | Thursday, 09 November 2006, 10:57:18 |
Data storage class to pass UIAction perform actions. Used by ActionQueue.
Summary
Constructor
- ActionQueuePerformData (inPerformFunction:Function, inDuration:Number, inStartValue:Number, inEndValue:Number, inEffect:Function, inEffectParams:Array)
- Creates a new ActionQueuePerformData object, with optionally the most frequent used parameters.
Instance properties
- method : Function
- The (object's) function to call.
- methodOwner : Object
- The function owner.
- duration : Number
- Duration of the animation in seconds.
- start : Number
- Percentage start value to get returned to method.
- end : Number
- Percentage end value to get returned to method.
- effect : Function
- An effect function, for instance one of the mx.transitions.easing methods.
- effectParams : Array
- Arguments to pass the effect function.
- loop : Boolean
- True if method should be called repeatedly; default value is false.
- afterMethod : Function
- Method to be called after the animation.
Instance methods
- toString : String
Constructor
ActionQueuePerformData
function ActionQueuePerformData (
inPerformFunction:Function,
inDuration:Number,
inStartValue:Number,
inEndValue:Number,
inEffect:Function,
inEffectParams:Array)
Creates a new ActionQueuePerformData object, with optionally the most frequent used parameters.
Parameters:
inPerformFunction:
the (object's) function to call
inDuration :
duration of the animation in seconds; if 0, inPerformFunction will be performed perpetually
inStartValue :
(optional) percentage start value to get returned to method
inEndValue :
(optional) percentage end value to get returned to method
inEffect :
(optional) an effect function, for instance one of the mx.transitions.easing methods
inEffectParams :
(optional) arguments to pass the effect function
Example:
- The first example is from AQFade, and illustrates conventional use:
private static var START_VALUE:Number = 1; private static var END_VALUE:Number = 0; var performFunction:Function = function (inPerc:Number) { // inPerc = percentage counting down from END_VALUE to START_VALUE // do something with inPerc... }; return new ActionQueuePerformData(performFunction, inDuration, START_VALUE, END_VALUE, inEffect, effectParams);
When the ActionQueue hits the next fade action,performFunctionwill be called duringinDuration, passing a value of inPerc betweenSTART_VALUEandEND_VALUE.
The following example is from AQSpring, and illustrates how the perform functionspringFunctionis passed with a duration of 0, making it the ActionQueue's performing function as long as the function does not returnfalse. When the method returns false, the ActionQueue moves on to the next action.var springFunction:Function = function() : Boolean { // spring calculations if ( inShouldHalt && Math.abs(xp) < inHaltSpeed) { return false; } return true; }; return new ActionQueuePerformData(springFunction, 0);
Instance properties
afterMethod
afterMethod:Function
(read)
Method to be called after the animation. After this method is called, the ActionQueue will continue to its next action.
duration
duration:Number
(read)
Duration of the animation in seconds.
effect
effect:Function
(read)
An effect function, for instance one of the mx.transitions.easing methods.
effectParams
effectParams:Array
(read)
Arguments to pass the effect function.
method
method:Function
(read)
Usage:
-
private static var START_VALUE:Number = 1; private static var END_VALUE:Number = 0; var performFunction:Function = function (inPerc:Number) { // inPerc = percentage counting down from END_VALUE to START_VALUE // do something with inPerc value }; ... return new ActionQueuePerformData(performFunction, inDuration, START_VALUE, END_VALUE, inEffect, effectParams);
methodOwner
methodOwner:Object
(read)
The function owner. Set to run the performing method within the scope of this object.
Example:
-
var performData:ActionQueuePerformData = new ActionQueuePerformData(performFunction, inDuration, inStartValue, inEndValue, inEffect, effectParams); performData.methodOwner = this; return performData;
Instance methods
toString
function toString (
) : String