Packagecom.hapticdata
Classpublic dynamic class AdvArray

Adds extra methods to arrays for easier manipulation



Public Methods
 MethodDefined by
  
AdvArray(... args)
AdvArray
  
append(a:Array):uint
add an array to the end of the existing AdvArray
AdvArray
  
appendAt(a:Array, index:uint = 0):uint
add an array at a given index of the existing AdvArray, defaults to the beginning of the array
AdvArray
  
clone():Array
makes a deep copy of the current array Flex3 LiveDocs: In a deep copy, any objects found in the original array are also copied so the the new array does not point to the same objects as does the original array.
AdvArray
  
contains(i:*):Boolean
allows you to search the array for a specific value, similar to MovieClip.contains()
AdvArray
  
pluck(index:int):*
pull an item out of the array by its index and re-sort the array
AdvArray
  
rotate(inc:int = 1):Array
allows you to specify a positive or negative value to cycle the array, 0 will do nothing
AdvArray
  
allows you to cycle an array one step backwards, placing the last item at the beginning of the array
AdvArray
  
rotateForward():Array
allows you to cycle an array one step forward, placing the first item at the end of the array
AdvArray
  
shallowCopy():Array
makes a shallow copy of the current array Flex3 LiveDocs: In a shallow copy, if the original array has elements that are objects, only the references to the objects are copied rather than the objects themselves.
AdvArray
Constructor detail
AdvArray()constructor
public function AdvArray(... args)Parameters
... args
Method detail
append()method
public function append(a:Array):uint

add an array to the end of the existing AdvArray

Parameters
a:Array — (Array) the array to append

Returns
uint — the new length of the array
appendAt()method 
public function appendAt(a:Array, index:uint = 0):uint

add an array at a given index of the existing AdvArray, defaults to the beginning of the array

Parameters
a:Array — (Array) the array to append
 
index:uint (default = 0) — (uint) the index of the array to start placing the new array

Returns
uint — the new length of the array
clone()method 
public function clone():Array

makes a deep copy of the current array Flex3 LiveDocs: In a deep copy, any objects found in the original array are also copied so the the new array does not point to the same objects as does the original array.

Returns
Array — a deep copy of the current array
contains()method 
public function contains(i:*):Boolean

allows you to search the array for a specific value, similar to MovieClip.contains()

Parameters
i:* — ( the value you are searching the array for

Returns
Boolean — returns Boolean

Example
if(myArray.contains("my string"))var myString:String = myArray.pluck(myArray.indexOf("my string"));

pluck()method 
public function pluck(index:int):*

pull an item out of the array by its index and re-sort the array

Parameters
index:int — (int) the index of the array to pluck

Returns
* — the item that was removed from the array
rotate()method 
public function rotate(inc:int = 1):Array

allows you to specify a positive or negative value to cycle the array, 0 will do nothing

Parameters
inc:int (default = 1) — (int) positive or negative value for direction and amount to rotate the array

Returns
Array — returns the new AdvArray
rotateBackwards()method 
public function rotateBackwards():Array

allows you to cycle an array one step backwards, placing the last item at the beginning of the array

Returns
Array — returns the new AdvArray
rotateForward()method 
public function rotateForward():Array

allows you to cycle an array one step forward, placing the first item at the end of the array

Returns
Array — returns the new AdvArray
shallowCopy()method 
public function shallowCopy():Array

makes a shallow copy of the current array Flex3 LiveDocs: In a shallow copy, if the original array has elements that are objects, only the references to the objects are copied rather than the objects themselves. The copy points to the same objects as the original does. Any changes made to the objects are reflected in both arrays.

Returns
Array — a shallow copy of the current array