The following are possible values for
•
Array.DESCENDING
•
Array.CASEINSENSITIVE
•
Array.NUMERIC
aren't numbers, use a string comparison (which can be case-insensitive if that flag is specified).
•
Array.UNIQUESORT
method returns an error code (0) instead of a sorted array.
•
Array.RETURNINDEXEDARRAY
example, the following array would return the second line of code and the array would remain
unchanged:
["a", "d", "c", "b"]
[0, 3, 2, 1]
You can combine these options into one value. For example, the following code combines options
3 and 1:
array.sort (Array.NUMERIC | Array.DESCENDING)
Returns
Nothing.
Description
Method; sorts the items in the data provider in the specified order, using the specified field name.
If the
fieldName
first. The
fieldName
specify any primitive value.
This method triggers the
This is the fastest way to sort data in a component. It also maintains the component's selection
state. The
sortItemsBy()
The
sortItems()
slower.
Example
The following code sorts the items in a list in ascending order using the labels of the list items:
myDP.sortItemsBy("label", "ASC");
300
Chapter 6: Components Dictionary
optionsFlag
—sorts highest to lowest.
—sorts case-insensitively.
—sorts numerically if the two elements being compared are numbers. If they
—if two objects in the array are identical or have identical sort fields, this
—returns an integer index array that is the result of the sort. For
items are a combination of text strings and integers, the integer items are listed
parameter is usually
modelChanged
method is fast because it doesn't run any ActionScript while sorting.
method needs to run an ActionScript compare function, and is therefore
:
or
, but advanced programmers may
"label"
"data"
event with the event name
.
sort
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?