Main Page | Packages | Class Tree | Index | Help

xp.events

interface IDispatcher

All Known Implementing Classes:
EventDispatcher

interface IDispatcher

Interface implemented by all event dispatchers



Method Summary

public
addEventListener ( target: Object, event: String, handler: Object, method: Object, tag: String ): Void
Registers a listener to a component instance.

public
dispatchEvent ( target: Object, e: Event ): Void
Dispatches an event programmatically.

public
removeEventListener ( target: Object, event: String, handler: Object, tag: String, all: Boolean ): Void
Removes an event listener from a component instance.



Method Documentation

addEventListener

public function addEventListener(target: Object,
 event: String,
 handler: Object,
 method: Object,
 tag: String): Void
Registers a listener to a component instance.

Registers a listener object with a component instance that is broadcasting an event.
When the event occurs, the listener object or function is notified.
You can call this method from any component instance.
For example, the following code registers a listener to the component instance myButton: myButton.addEventListener("click", myListener);

Parameters:
target
The name of the instance broadcasting the event.
event
A string that is the name of the event.
handler
A reference to a listener object or function.
method
A reference to method of the listener to be invoked when an event is dispatched.
tag
An optional tag to identify anonymous listeners

dispatchEvent

public function dispatchEvent(target: Object,
 e: Event): Void
Dispatches an event programmatically.

Dispatches an event to any listener registered with an instance of the class.
This method is usually called from within a component’s class file.
For example, the SimpleButton.as class file dispatches the click event.

Parameters:
target
The name of the instance broadcasting the event.
e
A reference to an event object.
The event object must have a type property that is a string indicating the name of the event.
You can define other properties on the event object that will help a user capture information about the event when it is dispatched.

removeEventListener

public function removeEventListener(target: Object,
 event: String,
 handler: Object,
 tag: String,
 all: Boolean): Void
Removes an event listener from a component instance.

Parameters:
target
The name of the instance broadcasting the event.
event
A string that is the name of the event.
handler
A reference to a listener object or function.
tag
An optional tag to identify anonymous listeners
all
If true remove all listeners for this event

The documentation was generated from the following file:


Generated on 10/30/2005 9:34:02 PM by AS2Doc