User Guide

1268 Tree component (Flash Professional only)
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
<node>, which doesnt have a label,
so it doesnt display correctly.
To avoid this problem, the data provider for the Tree component should point at the
XMLDocumentObjects 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 the Component inspector:
multipleSelection is a Boolean value that indicates whether a user can select multiple items
(
true) or not (false). The default value is 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 “Tree class (Flash
Professional only)” on page 1278.
You cannot enter data parameters in the Property inspector or the Component inspector for
the Tree component as you can with other components. For more information, see “Using the
Tree component (Flash Professional only)” on page 1266 and “Creating an application with
the Tree component” on page 1268.
Creating an application with the Tree component
The following procedures show how to use a Tree component to display mailboxes in an e-
mail application.
The Tree component does not allow you to enter data parameters in the Property inspector or
Component inspector. Because of the complexity of a Tree component’s data structure, you
must either import an XML object at runtime or build one in Flash while authoring. To
create XML in Flash, you can use the TreeDataProvider interface, use the ActionScript XML
object, or build an XML string. Each of these options is explained in the following
procedures.
To add a Tree component to an application and load XML:
1. In Flash, select File > New and select Flash Document.
2. Save the document as treeMenu.fla.
3. In the Components panel, double-click the Tree component to add it to the Stage.