Using The Tree Component (Flash Professional Only) - MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference

Components language reference
Table of Contents

Advertisement

Using the Tree component (Flash
Professional only)
The Tree component can be used to represent hierarchical data such as e-mail client folders,
file browser panes, or category browsing systems for inventory. Most often, the data for a tree
is retrieved from a server in the form of XML, but it can also be well-formed XML that is
created during authoring in Flash. The best way to create XML for the tree is to use the
TreeDataProvider interface. You can also use the ActionScript XML class or build an XML
string. After you create an XML data source (or load one from an external source), you assign
it to
Tree.dataProvider
The Tree component comprises two sets of APIs: the Tree class and the TreeDataProvider
interface. The Tree class contains the visual configuration methods and properties. The
TreeDataProvider interface lets you construct XML and add it to multiple tree instances. A
TreeDataProvider object broadcasts changes to any trees that use it. In addition, any XML or
XMLNode object that exists on the same frame as a tree or a menu is automatically given the
TreeDataProvider methods and properties. For more information, see
interface (Flash Professional only)" on page
Formatting XML for the Tree component
The Tree component is designed to display hierarchical data structures using XML as the data
model. It is important to understand the relationship of the XML data source to the Tree
component.
Consider the following XML data source sample:
<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>
The
attribute is read-only; you cannot set it directly. To set it, call
isBranch
Tree.setIsBranch()
1266
Tree component (Flash Professional only)
.
1257.
.
"TreeDataProvider

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents