F > FListBox.sortItemsBy

 

FListBox.sortItemsBy

Availability

Flash Player 6.

Usage

myListBox.sortItemsBy(fieldName, order)

Parameters

fieldName A string specifying the name of the field used for sorting. This will normally be "label" or "data".

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

Returns

Nothing.

Description

Method; sorts the items in the list box alphabetically or numerically, in the specified order, using the specified field name. 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 advanced users and programmers can specify any primitive that suits their needs.

Example

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

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

See also

FListBox.addItemAt, FListBox.replaceItemAt