deleteCount
includes the element specified in the
the method deletes all the values from the
value is 0, no elements are deleted.
An optional parameter that specifies the values to insert into the array at the insertion
value
point specified in the
Returns
An array containing the elements that were removed from the original array.
Description
Method; adds and removes elements from an array. This method modifies the array without
making a copy.
Example
The following example creates an array and splices it using element index 1 for the
parameter. This removes all elements from the array starting with the second element, leaving
only the element at index 0 in the original array:
var myPets_array:Array = new Array("cat", "dog", "bird", "fish");
trace( myPets_array.splice(1) ); // dog,bird,fish
trace( myPets_array ); // cat
The following example creates an array and splices it using element index 1 for the
parameter and the number 2 for the
the array, starting with the second element, leaving the first and last elements in the original array:
var myFlowers_array:Array = new Array("roses", "tulips", "lilies", "orchids");
trace( myFlowers_array.splice(1,2 ) ); // tulips,lilies
trace( myFlowers_array ); // roses,orchids
The following example creates an array and splices it using element index 1 for the
parameter, the number 0 for the
parameter. This does not remove anything from the original array, and adds the string
index 1:
var myFurniture_array:Array = new Array("couch", "bed", "desk", "lamp");
trace( myFurniture_array.splice(1,0, "chair" ) ); // displays empty array
trace( myFurniture_array ); // displays couch,chair,bed,desk,lamp
Array.toString()
Availability
Flash Player 5.
Usage
my_array.toString() : String
An integer that specifies the number of elements to be deleted. This number
start
parameter.
start
deleteCount
deleteCount
parameter. If no value is specified for
element to the last element in the array. If the
start
parameter. This removes two elements from
parameter, and the string
,
deleteCount
start
start
start
for the
chair
value
at
chair
Array.toString()
255
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?