com.bumpslide.util.ArrayUtil
David's handy Array utility methods You can never have enough deep copy implementations
static function in_array(needle, haystack:Array)Checks for the existence of a value in an array concept borrowed from php's in_array function
needle | |
haystack |
static function shuffle(a:Array)Shuffles (modifies original) array for card games and such :)
a | array to shuffle |
static function findObject(arrayOfObjects:Array, propToSearch:String, valueToFind)Array search utility Soes something like... SELECT * FROM arrayOfObjects WHERE propToSearch = valueToFind Note: If you are using this, you might be better off with a lookup table or XPath.
arrayOfObjects | |
propToSearch | string name of property to query |
valueToFind |
static function dCopy(obj)Recursively copies (deep copies) an array or an object There are no recursion limit checks here. Use at your own risk. ObjecUtil.clone is an alias of this method.
obj |
static public function indexOf(array:Array, object):Number
Returns the index of first occurance of the given object within
the passed-in array.
The content of the array is searched through by iterating through the
array. This method returns the first occurence of the passed-in object
within the array. If the object could not be found -1 will be
returned.
Blatantly stolen from AS2LIB
array | the array to search through |
object | the object to return the position of |
the position of the object within the array or -1
static public function lastIndexOf(array:Array, object):Number
Returns the index of the last occurance of the given object within
the passed-in array.
The content of the array is searched through by iterating through the
array. This method returns the last occurence of the passed-in object
within the array. If the object could not be found -1 will be
returned.
Blatantly stolen from AS2LIB
array | the array to search through |
object | the object to return the position of |
the position of the object within the array or -1