target.setStyle(style, source.getStyle(style));
}
To provide styles for the List component but not for components that extend List (DataGrid and
Tree), you must provide class-level style declarations for these subclasses.
import mx.styles.CSSStyleDeclaration;
if (_global.styles.DataGrid == undefined) {
_global.styles.DataGrid = new CSSStyleDeclaration();
}
_global.styles.DataGrid.setStyle("backgroundColor", 0xFFFFFF);
if (_global.styles.Tree == undefined) {
_global.styles.Tree = new CSSStyleDeclaration();
}
_global.styles.Tree.setStyle("backgroundColor", 0xFFFFFF);
For more information about class-level styles, see
on page
71.
Using skins with the List component
The List component uses an instance of RectBorder for its border and scroll bars for scrolling
images. For more information about skinning these visual elements, see
on page 647
and
List class
Inheritance
MovieClip >
ScrollSelectList > List
ActionScript Class Name
The List component is composed of three parts: items, rows, and a data provider.
An item is an ActionScript object used for storing the units of information in the list. A list can be
thought of as an array; each indexed space of the array is an item. An item is an object that
typically has a
label
A row is a component that is used to display an item. Rows are either supplied by default by the
list (the SelectableRow class is used), or you can supply them, usually as a subclass of the
SelectableRow class. The SelectableRow class implements the CellRenderer API, which is the set
of properties and methods that allow the list to manipulate each row and send data and state
information (for example, size, selected, and so on) to the row for display.
A data provider is a data model of the list of items in a list. Any array in the same frame as a list is
automatically given methods that let you manipulate data and broadcast changes to multiple
views. You can build an Array instance or get one from a server and use it as a data model for
multiple lists, combo boxes, data grids, and so on. The List component has methods that proxy to
its data provider (for example,
provided to the list, these methods create a data provider instance automatically, which is exposed
through
List.dataProvider
456
Chapter 6: Components Dictionary
"Using skins with the UIScrollBar component" on page
UIObject class
mx.controls.List
property that is displayed and a
addItem()
.
"Setting styles for a component class"
>
UIComponent class
property that is used for storing data.
data
and
). If no external data provider is
removeItem()
"RectBorder class"
831.
> View > ScrollView >
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?
Questions and answers