User Guide
List component 457
To add a List component to the tab order of an application, set its tabIndex property (see
UIComponent.tabIndex). The List component uses the Focus Manager to override the default
Flash Player focus rectangle and draw a custom focus rectangle with rounded corners. For more
information, see “Creating custom focus navigation” on page 50.
Each component class has a
version property, which is a class property. Class properties are
available only on the class itself. The
version property returns a string that indicates the version
of the component. To access this property, use the following code:
trace(mx.controls.List.version);
Note: The code
trace(myListInstance.version); returns undefined.
Method summary for the List class
The following table lists methods of the List class.
Methods inherited from the UIObject class
The following table lists the methods the List class inherits from the UIObject class. When calling
these methods, use the form
listInstance.methodName.
Method Description
List.addItem() Adds an item to the end of the list.
List.addItemAt() Adds an item to the list at the specified index.
List.getItemAt() Returns the item at the specified index.
List.removeAll() Removes all items from the list.
List.removeItemAt() Removes the item at the specified index.
List.replaceItemAt() Replaces the item at the specified index with another item.
List.setPropertiesAt() Applies the specified properties to the specified item.
List.sortItems() Sorts the items in the list according to the specified compare
function.
List.sortItemsBy() Sorts the items in the list according to a specified property.
Method Description
UIObject.createClassObject() Creates an object on the specified class.
UIObject.createObject() Creates a subobject on an object.
UIObject.destroyObject() Destroys a component instance.
UIObject.doLater() Calls a function when parameters have been set in the Property and
Component inspectors.
UIObject.getStyle() Gets the style property from the style declaration or object.
UIObject.invalidate() Marks the object so it will be redrawn on the next frame interval.
UIObject.move() Moves the object to the requested position.