User Guide

List component 455
Setting styles for all List components in a document
The List class 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 will be
reflected in all affected components.
_global.styles.ScrollSelectList.setStyle("backgroundColor", 0xFF00AA);
To set a style property on the List and List-based components only, you can create a new
CSSStyleDeclaration instance and store it in _global.styles.List.
import mx.styles.CSSStyleDeclaration;
if (_global.styles.List == undefined) {
_global.styles.List = new CSSStyleDeclaration();
}
_global.styles.List.setStyle("backgroundColor", 0xFF00AA);
When creating a new class-level style declaration, you will 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..in loop to copy the old settings to the new declaration.
var source = _global.styles.ScrollSelectList;
var target = _global.styles.List;
for (var style in source) {
selectionDisabledColor
Both The background color of a selected row. The default value is
a 0xDDDDDD (medium gray). Because the default value
for this property is the same as the default for
backgroundDisabledColor, the selection is not visible when
the component is disabled unless one of these style
properties is changed.
selectionEasing
Both A reference to the easing equation used to control the
transition between selection states. This applies only for the
transition from a normal to a selected state. The default
equation uses a sine in/out formula. For more information,
see “Customizing component animations” on page 75.
textRollOverColor
Both The color of text when the mouse pointer rolls over it. The
default value is 0x2B333C (dark gray). This style is
important when you set
rollOverColor, because the two
settings must complement each other so that text is easily
viewable during a rollover.
textSelectedColor
Both The color of text in the selected row. The default value is
0x005F33 (dark gray). This style is important when you set
selectionColor, because the two settings must
complement each other so that text is easily viewable while
selected.
useRollOver
Both Determines whether rolling over a row activates
highlighting. The default value is
true.
Style Theme Description