Access keys

ActionQueuePerformData

Kind of class: class
Inherits from: none
Author: Arthur Clemens
Classpath: org.asapframework.util.actionqueue.ActionQueuePerformData
File last modified: Thursday, 12 October 2006, 11:09:56
Data storage class to pass UIAction perform actions.
Used by ActionQueue.

Summary

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:
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, performFunction will be called during inDuration, passing a value of inPerc between START_VALUE and END_VALUE.
The following example is from AQSpring, and illustrates how the perform function springFunction is passed with a duration of 0, making it the ActionQueue's performing function as long as the function does not return false. 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,write)
Method to be called after the animation. After this method is called, the ActionQueue will continue to its next action.

duration

duration:Number
(read,write)
Duration of the animation in seconds.

effect

effect:Function
(read,write)
An effect function, for instance one of the mx.transitions.easing methods.

effectParams

effectParams:Array
(read,write)
Arguments to pass the effect function.

end

end:Number
(read,write)
Percentage end value to get returned to method.

loop

loop:Boolean = false
(read,write)
True if method should be called repeatedly; default value is false.

method

method:Function
(read,write)
The (object's) function to call. This function receives a percentage value between start and end.
Usage:
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,write)
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;

start

start:Number
(read,write)
Percentage start value to get returned to method.

Instance methods

toString

function toString (
) : String