![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
Flash Player 6.0.79.
Flash MX 2004.
listInstance
.sortItems(compareFunc
)
compareFunc
A reference to a function. This function is used to compare two items to determine their sort order.
For more information, see Array.sort()
in ActionScript Dictionary Help.
The index at which the item was added.
Method; sorts the items in the list according to the compareFunc parameter.
The following example sorts the items based on uppercase labels. Note that the a
and b
parameters that are passed to the function are items that have label
and data
properties:
myList.sortItems(upperCaseFunc); function upperCaseFunc(a,b){ return a.label.toUpperCase() > b.label.toUpperCase(); }
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |