Class enchant.EventTarget
A class for implementation of events similar to DOM Events. However, it does not include the concept of phases.
- Defined in: enchant.js
Constructor Attributes | Constructor Name and Description |
---|---|
Method Summary
Method Attributes | Method Name and Description |
---|---|
addEventListener(type, listener)
Add a new event listener which will be executed when the event
is dispatched.
|
|
clearEventListener(type)
Clear all defined event listeners of a given type.
|
|
Issue an event.
|
|
on(type, listener)
Synonym for addEventListener.
|
|
removeEventListener(type, listener)
Delete an event listener.
|
Class Detail
enchant.EventTarget()
Method Detail
-
addEventListener(type, listener)Add a new event listener which will be executed when the event is dispatched.
- Parameters:
- {String} type
- Type of the events.
- {Function(e:enchant.Event)} listener
- Event listener to be added.
-
clearEventListener(type)Clear all defined event listeners of a given type. If no type is given, all listeners will be removed.
- Parameters:
- {String} type
- Type of the events.
-
dispatchEvent(e)Issue an event.
- Parameters:
- {enchant.Event} e
- Event to be issued.
-
on(type, listener)Synonym for addEventListener.
- Parameters:
- {String} type
- Type of the events.
- {Function(e:enchant.Event)} listener
- Event listener to be added.
-
removeEventListener(type, listener)Delete an event listener.
- Parameters:
- {String} type Optional
- Type of the events.
- {Function(e:enchant.Event)} listener
- Event listener to be deleted.