This class manages a list of callback functions.
public var _linkableObject:ILinkableObject
protected var _preCallback:Function = null
This is the function that gets called immediately before every callback.
callbacksAreDelayed:Boolean
[read-only]
Implementation public function get callbacksAreDelayed():Boolean
triggerCounter:uint
[read-only]
Implementation public function get triggerCounter():uint
wasDisposed:Boolean
[read-only]
This flag becomes true after dispose() is called.
Implementation public function get wasDisposed():Boolean
public function CallbackCollection(preCallback:Function = null)
Parameters | preCallback:Function (default = null ) — An optional function to call before each immediate callback.
If specified, the preCallback function will be called immediately before running each
callback using the parameters passed to _runCallbacksImmediately(). This means if there
are five callbacks added, preCallback() gets called five times whenever
_runCallbacksImmediately() is called. An example usage of this is to make sure a relevant
variable is set to the appropriate value while each callback is running. The preCallback
function will not be called before grouped callbacks.
|
protected final function _runCallbacksImmediately(... preCallbackParams):void
This function runs callbacks immediately, ignoring any delays.
The preCallback function will be called with the specified preCallbackParams arguments.
Parameters
| ... preCallbackParams — The arguments to pass to the preCallback function given in the constructor.
|
public function addDisposeCallback(relevantContext:Object, callback:Function, allowDelay:Boolean = false):void
Parameters
| relevantContext:Object |
|
| callback:Function |
|
| allowDelay:Boolean (default = false )
|
public function addGroupedCallback(relevantContext:Object, groupedCallback:Function, triggerCallbackNow:Boolean = false, delayWhileBusy:Boolean = true):void
Parameters
| relevantContext:Object |
|
| groupedCallback:Function |
|
| triggerCallbackNow:Boolean (default = false )
|
|
| delayWhileBusy:Boolean (default = true )
|
public final function addImmediateCallback(relevantContext:Object, callback:Function, runCallbackNow:Boolean = false, alwaysCallLast:Boolean = false):void
Parameters
| relevantContext:Object |
|
| callback:Function |
|
| runCallbackNow:Boolean (default = false )
|
|
| alwaysCallLast:Boolean (default = false )
|
public final function delayCallbacks():void
public function dispose():void
public final function removeCallback(relevantContext:Object, callback:Function):void
Parameters
| relevantContext:Object |
|
| callback:Function |
public final function resumeCallbacks():void
public final function triggerCallbacks():void
public static const DEFAULT_TRIGGER_COUNT:uint = 1
This is the default value of triggerCounter.
The default value is 1 to avoid being equal to a newly initialized uint=0.
public static const STACK_TRACE_TRIGGER:String = This is the stack trace from when the callbacks were last triggered.
Wed Jun 28 2017, 02:22 PM -04:00