User Guide

1278 Tree component (Flash Professional only)
Setting styles for all Tree components in a document
The Tree class inherits from the List class, which inherits from the ScrollSelectList class. The
default class-level style properties are defined on the ScrollSelectList class, which the Menu
component and all List-based components extend. You can set new default style values on this
class directly, and the new settings are reflected in all affected components.
_global.styles.ScrollSelectList.setStyle("backgroundColor", 0xFF00AA);
To set a style property on the Tree components only, you can create a new
CSSStyleDeclaration instance and store it in _global.styles.DataGrid.
import mx.styles.CSSStyleDeclaration;
if (_global.styles.Tree == undefined) {
_global.styles.Tree = new CSSStyleDeclaration();
}
_global.styles.Tree.setStyle("backgroundColor", 0xFF00AA);
When you create a new class-level style declaration, you lose all default values provided by the
ScrollSelectList declaration. This includes backgroundColor, which is required for
supporting mouse events. To create a class-level style declaration and preserve defaults, use a
for loop, as follows, to copy the old settings to the new declaration.
var source = _global.styles.ScrollSelectList;
var target = _global.styles.Tree;
for (var style in source) {
target.setStyle(style, source.getStyle(style));
}
Using skins with the Tree component
The Tree component uses an instance of RectBorder for its border and scroll bars for scrolling
images. For more information about skinning these visual elements, see “RectBorder class
on page 1063 and “Using skins with the UIScrollBar component” on page 1394.
Tree class (Flash Professional only)
Inheritance MovieClip > UIObject class > UIComponent class > View > ScrollView >
ScrollSelectList > List component > Tree
ActionScript Class Name mx.controls.Tree
The methods, properties, and events of the Tree class allow you to manage and manipulate
Tree objects.