ActionScript 2.0 Components Language Reference |
|
|
|
| Tree component > Tree.getTreeNodeAt() | |||
Flash Player 6 (6.0.79.0).
Flash MX Professional 2004.
treeInstance.getTreeNodeAt(index)
index The index number of a node.
An XMLNode object.
Method; returns the specified node on the root of myTree.
The following example adds a node to the Tree instance my_tr, and then calls the getTreeNodeAt() method to return the first node in the tree.
You must first add an instance of the Tree component to the Stage and name it my_tr; then add the following code to Frame 1.
/**
Requires:
- Tree component on Stage (instance name: my_tr)
*/
var my_tr:mx.controls.Tree;
my_tr.setSize(200, 100);
var trDP_xml:XML = new XML("<node label=\"1st Local Folders\"><node label=\"Inbox\" data=\"0\" /><node label=\"Outbox\" data=\"1\" /></node>");
my_tr.dataProvider = trDP_xml;
trace(my_tr.getTreeNodeAt(0));
|
|
|
|