unshift (Array.unshift method)
public unshift(value:Object) : Number
Adds one or more elements to the beginning of an array and returns the new length of the
array.
Availability: ActionScript 1.0; Flash Player 5
Parameters
- One or more numbers, elements, or variables to be inserted at the beginning
value:Object
of the array.
Returns
- An integer representing the new length of the array.
Number
Example
The following example shows the use of the
var pets_array:Array = new Array("dog", "cat", "fish");
trace( pets_array ); // Displays dog,cat,fish.
pets_array.unshift("ferrets", "gophers", "engineers");
trace( pets_array ); // Displays ferrets,gophers,engineers,dog,cat,fish.
See also
pop (Array.pop method)
AsBroadcaster
Object
|
+-AsBroadcaster
public class AsBroadcaster
extends Object
A common mistake is to capitalize the second letter of
AsBroadcaster.initialize()
misspelling of
AsBroadcaster
Availability: ActionScript 1.0; Flash Player 6
Array.unshift()
,
push (Array.push method)
method, ensure that the second letter is lowercase. Any
fails silently.
method:
,
shift (Array.shift method)
. When calling the
AsBroadcaster
AsBroadcaster
265
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?