ActionScript 2.0 Components Language Reference |
|
|
|
| TreeDataProvider interface > TreeDataProvider.addTreeNode() | |||
Flash Player 6 (6.0.79.0).
Flash MX Professional 2004.
Usage 1:
someNode.addTreeNode(label,data)
Usage 2:
someNode.addTreeNode(child)
label A string that displays the node.
data An object of any type that is associated with the node.
child Any XMLNode object.
The added XML node.
Method; adds a child node at the root of the tree. The node is constructed either from the information supplied in the label and data parameters (Usage 1), or from the prebuilt child node, which is an XMLNode object (Usage 2). Adding a preexisting node removes the node from its previous location.
Calling this method refreshes the display of the tree.
The first line of code in the following example locates the node to which to add a child. The second line adds a new node to a specified node.
var myTreeNode = myTreeDP.firstChild.firstChild;
myTreeNode.addTreeNode("Inbox", 3);
The following code moves a node from one tree to the root of another tree:
myTreeNode.addTreeNode(mySecondTree.getTreeNodeAt(3));
|
|
|
|