| Package | com.threerings.util |
| Class | public class EventHandlers |
| Property | Defined by | ||
|---|---|---|---|
| _mgr : EventHandlerManager
[static]
| EventHandlers | ||
| Method | Defined by | ||
|---|---|---|---|
|
callWhenTrue(callback:Function, callNow:Boolean, dispatcher:IEventDispatcher, event:String, useCapture:Boolean = false, priority:int = 0):void
[static]
Will either call a given function now, or defer it based on the boolean parameter.
| EventHandlers | ||
|
freeAllHandlers(... ignored):void
[static]
Free all handlers that have been added via this registerListener() and have not been
freed already via unregisterListener()
| EventHandlers | ||
|
[static]
Returns the global manager that is accessed by all of the static members of this class.
| EventHandlers | ||
|
registerListener(dispatcher:IEventDispatcher, event:String, listener:Function, useCapture:Boolean = false, priority:int = 0):void
[static]
Adds the specified listener to the specified dispatcher for the specified event.
| EventHandlers | ||
|
registerListenerUntil(triggerDispatcher:IEventDispatcher, triggerEvent:String, dispatcher:IEventDispatcher, event:String, listener:Function):void
[static]
Will register a listener on a dispatcher for an event until the trigger event has been
dispatched on the trigger dispatcher.
| EventHandlers | ||
|
registerOneShotCallback(dispatcher:IEventDispatcher, event:String, callback:Function, useCapture:Boolean = false, priority:int = 0):void
[static]
Registers a zero-arg callback function that should be called once when the event fires.
| EventHandlers | ||
|
registerUnload(dispatcher:IEventDispatcher):void
[static]
Registers the freeAllHandlers() method to be called upon Event.UNLOAD on the supplied
event dispatcher.
| EventHandlers | ||
|
unregisterListener(dispatcher:IEventDispatcher, event:String, listener:Function, useCapture:Boolean = false):void
[static]
Removes the specified listener from the specified dispatcher for the specified event.
| EventHandlers | ||
| _mgr | property |
protected static var _mgr:EventHandlerManager
| callWhenTrue | () | method |
public static function callWhenTrue(callback:Function, callNow:Boolean, dispatcher:IEventDispatcher, event:String, useCapture:Boolean = false, priority:int = 0):voidWill either call a given function now, or defer it based on the boolean parameter. If the parameter is false, the function will be registered as a one-shot callback on the dispatcher
Parameterscallback:Function |
|
callNow:Boolean |
|
dispatcher:IEventDispatcher |
|
event:String |
|
useCapture:Boolean (default = false) |
|
priority:int (default = 0) |
| freeAllHandlers | () | method |
public static function freeAllHandlers(... ignored):voidFree all handlers that have been added via this registerListener() and have not been freed already via unregisterListener()
Parameters... ignored |
| getGlobalManager | () | method |
public static function getGlobalManager():EventHandlerManagerReturns the global manager that is accessed by all of the static members of this class.
ReturnsEventHandlerManager |
| registerListener | () | method |
public static function registerListener(dispatcher:IEventDispatcher, event:String, listener:Function, useCapture:Boolean = false, priority:int = 0):voidAdds the specified listener to the specified dispatcher for the specified event.
Parametersdispatcher:IEventDispatcher |
|
event:String |
|
listener:Function |
|
useCapture:Boolean (default = false) |
|
priority:int (default = 0) |
| registerListenerUntil | () | method |
public static function registerListenerUntil(triggerDispatcher:IEventDispatcher, triggerEvent:String, dispatcher:IEventDispatcher, event:String, listener:Function):voidWill register a listener on a dispatcher for an event until the trigger event has been dispatched on the trigger dispatcher. Useful for attaching listeners until an object has been REMOVED_FROM_STAGE or UNLOADed. All associated event listeners use the default useCapture and priority settings.
ParameterstriggerDispatcher:IEventDispatcher |
|
triggerEvent:String |
|
dispatcher:IEventDispatcher |
|
event:String |
|
listener:Function |
| registerOneShotCallback | () | method |
public static function registerOneShotCallback(dispatcher:IEventDispatcher, event:String, callback:Function, useCapture:Boolean = false, priority:int = 0):voidRegisters a zero-arg callback function that should be called once when the event fires.
Parametersdispatcher:IEventDispatcher |
|
event:String |
|
callback:Function |
|
useCapture:Boolean (default = false) |
|
priority:int (default = 0) |
| registerUnload | () | method |
public static function registerUnload(dispatcher:IEventDispatcher):voidRegisters the freeAllHandlers() method to be called upon Event.UNLOAD on the supplied event dispatcher.
Parametersdispatcher:IEventDispatcher |
| unregisterListener | () | method |
public static function unregisterListener(dispatcher:IEventDispatcher, event:String, listener:Function, useCapture:Boolean = false):voidRemoves the specified listener from the specified dispatcher for the specified event.
Parametersdispatcher:IEventDispatcher |
|
event:String |
|
listener:Function |
|
useCapture:Boolean (default = false) |