Version 2 components use a dispatcher/listener event model. The Tree component dispatches a
event when a node is clicked open by a user; the event is handled by a function, also
nodeOpen
called a handler, that is attached to a listener object (
the
addEventListener()
When the event is triggered, it automatically passes an event object (
handler. Each event object has properties that contain information about the event. You can use
these properties to write code that handles the event. The
one additional property:
For more information, see
Example
In the following example, a handler called
myTree.addEventListener()
handler in the
nodeOpen
statement is sent to the Output panel.
myTreeListener = new Object();
myTreeListener.nodeOpen = function(evtObject){
trace(evtObject.node + " node was opened");
}
myTree.addEventListener("nodeOpen", myTreeListener);
Tree.refresh()
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
myTree.refresh()
Parameters
None.
Returns
Nothing.
Description
Method; updates the tree.
782
Chapter 6: Components Dictionary
method and pass it the name of the handler as a parameter.
(the XML node that was opened).
node
"EventDispatcher class" on page
myTreeListener
as the second parameter. The event object is captured by the
parameter. When the
evtObject
) that you create. You call
listenerObject
eventObject
event's event object has
Tree.nodeOpen
415.
is defined and passed to
event is broadcast, a
nodeOpen
) to the
trace
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?
Questions and answers