MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 208

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

Parameters
compareFunc
For details, see
Array.sort()
is optional.
optionsFlag
having to replicate the entire array or re-sort it repeatedly. This parameter is optional.
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.
Array.RETURNINDEXEDARRAY
sort. For 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 combo box according to the specified compare function or
according to the specified sort options.
Example
This example sorts according to uppercase labels. The items
and contain
label
myComboBox.sortItems(upperCaseFunc);
function upperCaseFunc(a,b){
return a.label.toUpperCase() > b.label.toUpperCase();
}
The following example uses the
parameter to sort the elements of a ComboBox instance named
optionsFlag
myComboBox.addItem("Mercury");
myComboBox.addItem("Venus");
myComboBox.addItem("Earth");
myComboBox.addItem("planet");
208
Chapter 6: Components Dictionary
A reference to a function that compares two items to determine their sort order.
in Flash ActionScript Language Reference. This parameter
Lets you perform multiple sorts of different types on a single array without
optionsFlag
, which sorts 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
, which returns an integer index array that is the result of the
and
fields:
data
upperCaseFunc()
:
and
are passed to the function
a
b
function defined above, along with the
:
myComboBox

Advertisement

Table of Contents
loading
Need help?

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

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents