MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference page 260

Actionscript 2.0 language reference
Table of Contents

Advertisement

Availability: ActionScript 1.0; Flash Player 6 - The options parameter was added in Flash
Player 7. The ability to use different options parameters on multiple sort fields was added in
Flash Player 8.
Parameters
- A string that identifies a field to be used as the sort value, or an array in
fieldName:Object
which the first element represents the primary sort field, the second represents the secondary
sort field, and so on.
[optional] - One or more numbers or names of defined constants, separated
options:Object
by the
bitwise OR (|)
acceptable for the
options
Array.CASEINSENSITIVE
Array.DESCENDING
Array.UNIQUESORT
Array.RETURNINDEXEDARRAY
or 16
Array.NUMERIC
Code hinting is enabled if you use the string form of the flag (for example,
rather than the numeric form (2).
Returns
- The return value depends on whether you pass any parameters:
Array
If you specify a value of 4 or
more elements being sorted have identical sort fields, a value of 0 is returned and the array
is not modified.
If you specify a value of 8 or
array is returned that reflects the results of the sort and the array is not modified.
Otherwise, nothing is returned and the array is modified to reflect the sort order.
Example
The following example creates a new array and sorts it according to the
The first sort uses
name
as the first sort value and
city
var rec_array:Array = new Array();
rec_array.push({name: "john", city: "omaha", zip: 68144});
rec_array.push({name: "john", city: "kansas city", zip: 72345});
rec_array.push({name: "bob", city: "omaha", zip: 94010});
for(i=0; i<rec_array.length; i++){
trace(rec_array[i].name + ", " + rec_array[i].city);
260
ActionScript classes
operator, that change the sorting behavior. The following values are
parameter:
or 1
or 2
or 4
or 8
Array.UNIQUESORT
Array.RETURNINDEXEDARRAY
as the first sort value and
as the second.
name
for the
parameter, and two or
options
for the
options
as the second. The second sort uses
city
)
DESCENDING
parameter, an
and
fields.
name
city

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF