TimedAction

Kind of class: public class
Package:
Inherits from:
Implements:
Classpath: org.asaplibrary.util.actionqueue.TimedAction
File last modified: Wednesday, 11 May 2011, 18:55:36
A TimedAction is an Action that performs a function during a set time period.
Events broadcasted to listeners

Summary

Constructor
  • TimedAction (inMethod:Function, inDuration:Number = Number.NaN, inEffect:Function = null, inUndoMethod:Function = null, inUndoArgs:Array = null)
    • Creates a new TimedAction.
Instance methods
  • stop () : void
    • Stops the running action.
  • reset () : void
  • finish () : void
    • Stops the running action and sends out a "finished" message.
  • setLoop (inState:Boolean) : void
    • Sets the looping state of the action.
  • setLoopCount (inLoopCount:uint) : void
    • Sets the number of loops this action will perform.
  • doesLoop () : Boolean
  • isRunning () : Boolean
  • run () : *
    • Starts invoking the action method.
  • pause (inContinueWhereLeftOff:Boolean = true) : void
    • Pauses the action method.
  • resume () : void
    • Resumes a paused action.

Constructor

TimedAction

function TimedAction(inMethod:Function, inDuration:Number = Number.NaN, inEffect:Function = null, inUndoMethod:Function = null, inUndoArgs:Array = null)

Creates a new TimedAction.

Parameters
inMethod :function reference
inDuration :(optional) duration of the time period in seconds; the duration may be set to 0 - the action will then last indefinite
inUndoMethod:(optional) not implemented yet
inUndoArgs :(optional) not implemented yet

Instance methods

doesLoop

function doesLoop() : Boolean
Returns
  • True if the action loop state is set to true and the action is still running inside a loop; otherwise false

finish

function finish() : void

Stops the running action and sends out a "finished" message.

Events broadcasted to listeners

isRunning

override function isRunning() : Boolean
Overrides
Returns
  • True if the action is still running; otherwise false.

pause

function pause(inContinueWhereLeftOff:Boolean = true) : void

Pauses the action method.

Parameters
inContinueWhereLeftOff:(optional) whether the action should continue where it left off when the action is resumed

reset

function reset() : void

resume

function resume() : void

Resumes a paused action.

run

override function run() : *

Starts invoking the action method.

Overrides
Returns
  • null.

setLoop

function setLoop(inState:Boolean) : void

Sets the looping state of the action.

Parameters
inState:true: the action is looping; default false

setLoopCount

function setLoopCount(inLoopCount:uint) : void

Sets the number of loops this action will perform.

Parameters
inLoopCount:the number of loops this action will perform; use 0 to loop indefinitely

stop

function stop() : void

Stops the running action.

Events broadcasted to listeners