User Guide
776 Chapter 6: Components Dictionary
Parameters
index
The zero-based 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. This parameter is optional.
child Any XMLNode object.
Returns
The added XML node.
Description
Method; adds a node at the specified location in the tree. The node is constructed either from the
information supplied in the
label and data parameters (Usage 1), or from the prebuilt
XMLNode object (Usage 2). Adding a preexisting node removes the node from its previous
location.
Calling this method refreshes the view.
Example
The following example adds a new node as the second child of the root of myTree. The second
line moves a node from
mySecondTree to become the fourth child of the root of myTree:
myTree.addTreeNodeAt(1, "Inbox", 3);
myTree.addTreeNodeAt(3,mySecondTree.getTreeNodeAt(3));
Tree.dataProvider
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
myTree.dataProvider
Description
Property; either XML or a string. If dataProvider is an XML object, it is added directly to the
tree. If
dataProvider is a string, it must contain valid XML that is read by the tree and converted
to an XML object.
You can either load XML from an external source at runtime or create it in Flash while authoring.
To create XML, you can use either the TreeDataProvider methods, or the built-in ActionScript
XML class methods and properties. You can also create a string that contains XML.
XML objects that are on the same frame as a Tree component automatically contain the
TreeDataProvider methods and properties. You can use the ActionScript XML or
XMLNode object.