Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 1.0, Flash Player 9.0 |
Class that contains static utility methods for manipulating and working
with Arrays.
Note that all APIs assume that they are working with well formed arrays.
i.e. they will only manipulate indexed values.
public static function arrayContainsValue(arr:Array, value:Object):Boolean
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 1.0, Flash Player 9.0 |
Determines whether the specified array contains the specified value.
Parameters
| arr:Array — The array that will be checked for the specified value.
|
|
| value:Object — The object which will be searched for within the array
|
Returns | Boolean — True if the array contains the value, False if it does not.
|
public static function arraysAreEqual(arr1:Array, arr2:Array):Boolean
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 1.0, Flash Player 9.0 |
Compares two arrays and returns a boolean indicating whether the arrays
contain the same values at the same indexes.
Parameters
| arr1:Array — The first array that will be compared to the second.
|
|
| arr2:Array — The second array that will be compared to the first.
|
Returns | Boolean — True if the arrays contains the same values at the same indexes.
False if they do not.
|
public static function copyArray(arr:Array):Array
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 1.0, Flash Player 9.0 |
Creates a copy of the specified array.
Note that the array returned is a new array but the items within the
array are not copies of the items in the original array (but rather
references to the same items)
Parameters
| arr:Array — The array that will be copies
|
Returns | Array — A new array which contains the same items as the array passed
in.
|
public static function createUniqueCopy(a:Array):Array
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 1.0, Flash Player 9.0 |
Create a new array that only contains unique instances of objects
in the specified array.
Basically, this can be used to remove duplication object instances
from an array
Parameters
| a:Array — The array which contains the values that will be used to
create the new array that contains no duplicate values.
|
Returns | Array — A new array which only contains unique items from the specified
array.
|
public static function empty(arr:Array):void
Parameters
public static function insert(arr:Array, index:int, value:*):void
Parameters
| arr:Array |
|
| index:int |
|
| value:* |
public static function removeAt(arr:Array, index:int):void
Parameters
public static function removeValueFromArray(arr:Array, value:Object):void
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 1.0, Flash Player 9.0 |
Remove all instances of the specified value from the array,
Parameters
| arr:Array — The array from which the value will be removed
|
|
| value:Object — The object that will be removed from the array.
|
Sun Apr 17 2011, 12:17 AM -07:00