List.sortItemsBy()

Availability

Flash Player 6.0.79.

Edition

Flash MX 2004.

Usage

listInstance.sortItemsBy(fieldName, order)

Parameters

fieldName A string that specifies the name of the property to be used for sorting. Typically, this value is "label" or "data".

order A string that specifies whether to sort the items in ascending order ("ASC") or descending order ("DESC").

Returns

Nothing.

Description

Method; sorts the items in the list alphabetically or numerically, in the specified order, using the fieldName specified. If the fieldName items are a combination of text strings and integers, the integer items are listed first. The fieldName parameter is usually "label" or "data", but you can specify any primitive data value.

Example

The following code sorts the items in the list surnameMenu in ascending order using the labels of the list items:

surnameMenu.sortItemsBy("label", "ASC");

See also

List.sortItems()