import mx.collections.*
private var COLOR_ARRAY:Array= [{label:"Red", data:"#FF0000"},
{label:"Green", data:"#00FF00"},
{label:"Blue", data:"#0000FF"}];
// Declare an ArrayList variable for the colors.
// Make it Bindable so it can be used in bind
// expressions ({colorAL}).
[Bindable]
public var colorAL:ArrayList;
// Initialize colorAL ArrayList variable from the Array.
// Use an initialize event handler to initialize data variables
// that do not rely on components, so that the initial values are
// available when the controls that use them are constructed.
//See the mx:ArrayList tag, below, for a second way to
//initialize an ArrayList.
private function initData():void {
colorAL=new ArrayList(COLOR_ARRAY);
}
Juneau
Little Rock