Using the Tree component

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 TreeDataProvider interface.

Related topics