Class JSUTILS.EventDispatcher
The EventDispatcher class mimics the DOM event dispatcher model so the
user can add and remove event listeners in a familiar way. Event bubbling is
not available because events are dispatched in relation to state changes of
physical components instead of layered graphics so there is nothing to bubble up.
Defined in: EventDispatcher.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
JSUTILS.EventDispatcher(target)
An DOM-like or as3-like EventDispatcher class.
|
| Method Attributes | Method Name and Description |
|---|---|
|
addEventListener(type, listener)
Description
|
|
|
dispatchEvent(type, optionalParams)
Description
|
|
|
hasEventListener(type)
Description
|
|
|
removeEventListener(type, listener)
Description
|
Class Detail
JSUTILS.EventDispatcher(target)
An DOM-like or as3-like EventDispatcher class.
- Parameters:
- {Class} target
- The instance of the class that implements EventDispatcher
Method Detail
addEventListener(type, listener)
Description
- Parameters:
- {String} type
- The event type
- {Function} listener
- The function to be called when the event is fired
dispatchEvent(type, optionalParams)
Description
- Parameters:
- {Event} type
- The Event object.
- {Object} optionalParams
- Optional parameters passed as an object. return {boolean} True if dispatch is successful, false if not.
hasEventListener(type)
Description
- Parameters:
- {String} type
- The event type return {boolean} True is listener exists for this type, false if not.
removeEventListener(type, listener)
Description
- Parameters:
- {String} type
- The event type
- {Function} listener
- The function to be called when the event is fired
