Tree is a UI component that offers a convenient representation of hierarchical information (file folders, product catalogs, nested categories, etc.). The Astra Tree is built on top of the Flash CS3 List Component and is provided with a default TreeCellRenderer.
Getting Started: Tree for Flash CS3
The easiest way to create a Tree is to drag it from the Components panel to the stage. This will immediately create a Tree instance and add it to the display list. You may use the Properties panel to set some of its basic properties. An alternative way is to add the Tree component to the library, and then instantiate and add it to the display list in ActionScript:
Here's the functional Tree component (download the FLA):
To see a live example, please install Adobe Flash Player version 9 or higher.
To set the content of the Tree, you need to provide an XML data source and instantiate the Tree's dataProvider with a new TreeDataProvider. The Tree content is described by ordinary XML data. The Tree preserves the parent-child relationships among nodes exactly as they exist in the XML source.
To use the TreeDataProvider, include the following code in your application:
com.yahoo.astra.fl.controls.treeClasses.TreeDataProvider is the required DataProvider type for the Tree. It receives XML as its argument and parses it appropriately to be usable by the Tree component.
The following example instantiates a Tree and supplies it with a TreeDataProvider that receives custom XML.
For additional topics, please read Using Tree, or take a look at the Examples section for functional demonstrations. The ActionScript 3.0 Class Reference contains full details on every property, method, and style available to the Tree component.