Packagecom.whirled.contrib
Classpublic class TimerManager

A class for managing a group of timers.



Protected Properties
 PropertyDefined by
  _children : Array
TimerManager
  _freeSlots : Array
TimerManager
  _parent : TimerManager
TimerManager
  _timers : Array
TimerManager
Public Methods
 MethodDefined by
  
TimerManager(parent:TimerManager = null)
Constructs a new TimerManager.
TimerManager
  
Stops all timers being managed by this TimerManager.
TimerManager
  
Cancels a single running ManagedTimer.
TimerManager
  
createTimer(delay:Number, repeatCount:int, timerCallback:Function = null, completeCallback:Function = null):ManagedTimer
Creates, but doesn't run, a new ManagedTimer.
TimerManager
  
runForever(delay:Number, callback:Function):ManagedTimer
Creates and runs a timer that will run forever, or until canceled.
TimerManager
  
runOnce(delay:Number, callback:Function):void
Creates and runs a timer that will run once, and clean up after itself.
TimerManager
  
shutdown():void
Cancels all running timers, and disconnects the TimerManager from its parent, if it has one.
TimerManager
Protected Methods
 MethodDefined by
  
stopTimer(managedTimer:ManagedTimerImpl):void
TimerManager
Property detail
_childrenproperty
protected var _children:Array
_freeSlotsproperty 
protected var _freeSlots:Array
_parentproperty 
protected var _parent:TimerManager
_timersproperty 
protected var _timers:Array
Constructor detail
TimerManager()constructor
public function TimerManager(parent:TimerManager = null)

Constructs a new TimerManager.

Parameters
parent:TimerManager (default = null) — (optional) if not null, this TimerManager will become a child of the specified parent TimerManager. If the parent is shutdown, or its cancelAllTimers() function is called, this TimerManager will be similarly affected.
Method detail
cancelAllTimers()method
public function cancelAllTimers():void

Stops all timers being managed by this TimerManager. All child TimerManagers will have their timers stopped as well.

cancelTimer()method 
public function cancelTimer(timer:ManagedTimer):void

Cancels a single running ManagedTimer. The timer must have been created by this TimerManager.

Parameters
timer:ManagedTimer
createTimer()method 
public function createTimer(delay:Number, repeatCount:int, timerCallback:Function = null, completeCallback:Function = null):ManagedTimer

Creates, but doesn't run, a new ManagedTimer.

Parameters
delay:Number
 
repeatCount:int
 
timerCallback:Function (default = null)
 
completeCallback:Function (default = null)

Returns
ManagedTimer
runForever()method 
public function runForever(delay:Number, callback:Function):ManagedTimer

Creates and runs a timer that will run forever, or until canceled.

Parameters
delay:Number
 
callback:Function

Returns
ManagedTimer
runOnce()method 
public function runOnce(delay:Number, callback:Function):void

Creates and runs a timer that will run once, and clean up after itself.

Parameters
delay:Number
 
callback:Function
shutdown()method 
public function shutdown():void

Cancels all running timers, and disconnects the TimerManager from its parent, if it has one. All child TimerManagers will be shutdown as well. It's an error to call any function on TimerManager after shutdown() has been called.

stopTimer()method 
protected function stopTimer(managedTimer:ManagedTimerImpl):voidParameters
managedTimer:ManagedTimerImpl