When a Tree displays a node, it uses the
If any other attributes exist, they become additional properties of the node's attributes within
the tree.
The actual root node is interpreted as the Tree component itself. This means that the first child
(in the previous example,
This means that a tree can have multiple root folders. In the example, there is only one root folder
displayed in the tree: Mail. However, if you were to add sibling nodes at that level in the XML,
multiple root nodes would be displayed in the tree.
A data provider for a tree always wants a node that has children it can display. It displays the first
child of the XMLNode object. When the XML is wrapped in an XML object, the structure looks
like the following:
<XMLDocumentObject>
<node>
<node label="Mail">
<node label="INBOX"/>
<node label="Personal Folder">
<node label="Business" isBranch="true" />
<node label="Demo" isBranch="true" />
<node label="Personal" isBranch="true" />
<node label="Saved Mail" isBranch="true" />
<node label="bar" isBranch="true" />
</node>
<node label="Sent" isBranch="true" />
<node label="Trash"/>
</node>
</node>
</XMLDocumentObject>
Flash Player wraps the XML nodes in an extra document node, which is passed to the tree. When
the tree tries to display the XML, it tries to display
doesn't display correctly.
To avoid this problem, the data provider for the Tree component should point at the
XMLDocumentObject's first child, as shown here:
myTree.dataProvider = myXML.firstChild;
Tree parameters
You can set the following authoring parameters for each Tree component instance in the Property
inspector or in the Component inspector:
multipleSelection
(
) or not (
true
false
rowHeight
indicates the height of each row, in pixels. The default value is 20.
You can write ActionScript to control these and additional options for the Tree component using
its properties, methods, and events. For more information, see
only)" on page
770.
label
<node label="Mail">
is a Boolean value that indicates whether a user can select multiple items
). The default value is
attribute of the node by default as the text label.
), is rendered as the root node in the tree view.
, which doesn't have a label, so it
<node>
.
false
"Tree class (Flash Professional
Tree component (Flash Professional only)
761
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