EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE - Splice (Array.splice Method)

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE
780 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Array 265
// catchy
Performing a case-insensitive, descending sort on the password field produces the following
results:
my_array.sortOn("password", Array.CASEINSENSITIVE | Array.DESCENDING);
// catchy
// Bob
// barb
// abcd
Performing a default sort on the age field produces the following results:
my_array.sortOn("age");
// 29
// 3
// 35
// 4
Performing a numeric sort on the age field produces the following results:
my_array.sortOn("age", Array.NUMERIC);
// my_array[0].age = 3
// my_array[1].age = 4
// my_array[2].age = 29
// my_array[3].age = 35
Performing a descending numeric sort on the age field produces the following results:
my_array.sortOn("age", Array.DESCENDING | Array.NUMERIC);
// my_array[0].age = 35
// my_array[1].age = 29
// my_array[2].age = 4
// my_array[3].age = 3
When using the Array.RETURNEDINDEXARRAY sorting option, you must assign the return
value to a different array. The original array is not modified.
var indexArray:Array = my_array.sortOn("age", Array.RETURNINDEXEDARRAY);
See also
| bitwise OR operator, sort (Array.sort method)
splice (Array.splice method)
public splice(startIndex:Number, [deleteCount:Number], [value:Object]) :
Array
Adds elements to and removes elements from an array. This method modifies the array
without making a copy.
Availability: ActionScript 1.0; Flash Lite 2.0

Table of Contents

Related product manuals