Nodes in the XML data source can have any name. Notice in the previous example that each
node is named with the generic name
display hierarchy according to the nested relationship of the nodes.
Each XML node can be displayed as one of two types in the tree: branch or leaf. Branch nodes
can contain multiple child nodes and appear as a folder icon with an expander arrow that
allows users to open and close the folder. Leaf nodes appear as a file icon and cannot contain
child nodes. Both leaves and branches can be roots; a root node appears at the top level of the
tree and has no parent. The icons are customizable; for more information, see
with the Tree component" on page
There are many ways to structure XML, but the Tree component cannot use all types of XML
structures. Do not nest node attributes in a child node; each node should contain all its
necessary attributes. Also, the attributes of each node should be consistent to be useful. For
example, to describe a mailbox structure with a Tree component, use the same attributes on
each node (message, data, time, attachments, and so on). This lets the tree know what it
expects to render, and lets you loop through the hierarchy to compare data.
When a Tree displays a node, it uses the
label. 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,
tree view. 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>
. The tree reads through the XML and builds the
node
1278.
attribute of the node by default as the text
label
<node label="Mail">
Using the Tree component (Flash Professional only)
), is rendered as the root node in the
"Using skins
1267
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?
Questions and answers