EventDispatcher Class
The EventDispatcher mirrors the functionality of AS3 and CreateJS's EventDispatcher,
but is more robust in terms of inputs for the on()
and off()
methods.
Constructor
EventDispatcher
()
Methods
_callbackIndex
(
Int
private
-
name
-
callback
Returns callback array index.
Returns:
Int:
Callback array index, or -1 if isn't registered.
off
(
-
name
-
callback
Remove the event listener
on
(
EventDispatcher
-
name
-
callback
Add an event listener
Parameters:
Returns:
EventDispatcher:
Return this EventDispatcher
trigger
(
-
type
-
params
Dispatch an event
Parameters:
-
type
StringThe event string name,
-
params
Additional parameters