Description
Method; sorts the items in the list by using the function specified in the
Example
The following example sorts the items according to uppercase labels. Note that the
parameters that are passed to the function are items that have
myList.sortItems(upperCaseFunc);
function upperCaseFunc(a,b){
return a.label.toUpperCase() > b.label.toUpperCase();
}
See also
List.sortItemsBy()
List.sortItemsBy()
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
myList.sortItemsBy(fieldName, optionsFlag)
myList.sortItemsBy(fieldName, order)
Parameters
A string that specifies the name of the field to use for sorting. This value is usually
fieldName
or
"label"
"data"
A string that specifies whether to sort the items in ascending order (
order
order (
).
"DESC"
optionsFlag
having to replicate the entire array or resort it repeatedly.
The following are possible values for
•
Array.DESCENDING
•
Array.CASEINSENSITIVE
•
Array.NUMERIC
they aren't numbers, use a string comparison (which can be case-insensitive if that flag is
specified).
•
Array.UNIQUESORT
the array are identical or have identical sort fields.
.
Lets you perform multiple sorts of different types on a single array without
optionsFlag
, which sorts from highest to lowest.
, which sorts without regard to case.
, which sorts numerically if the two elements being compared are numbers. If
, which returns an error code (0) instead of a sorted array if two objects in
compareFunc
and
label
:
parameter.
and
a
b
properties.
data
) or descending
"ASC"
List component
481
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?
Questions and answers