ActionScript 2.0 Components Language Reference |
|
|
|
| TreeDataProvider interface > TreeDataProvider.addTreeNodeAt() | |||
Flash Player 6 (6.0.79.0).
Flash MX Professional 2004.
Usage 1:
someNode.addTreeNodeAt(index,label,data)
Usage 2:
someNode.addTreeNodeAt(index,child)
index An integer that indicates the index position (among the child nodes) at which the node should be added.
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 specified location in the parent node. 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 following code locates the node to which you will add a node and adds a new node as the second child of the root:
var myTreeNode = myTreeDP.firstChild.firstChild; myTreeNode.addTreeNodeAt(1, "Inbox", 3);
The following code moves a node from one tree to become the fourth child of the root of another tree:
myTreeNode.addTreeNodeAt(3, mySecondTree.getTreeNodeAt(3));
|
|
|
|