EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Unshift (Array.unshift Method); Asbroadcaster

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
AsBroadcaster 265
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
value:Object - One or more numbers, elements, or variables to be inserted at the beginning
of the array.
Returns
Number - An integer representing the new length of the array.
Example
The following example shows the use of the
Array.unshift() method:
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), push (Array.push method), shift (Array.shift method)
AsBroadcaster
Object
|
+-AsBroadcaster
public class AsBroadcaster
extends Object
Availability: ActionScript 1.0; Flash Player 6
NOTE
A common mistake is to capitalize the second letter of AsBroadcaster. When calling the
AsBroadcaster.initialize() method, ensure that the second letter is lowercase. Any
misspelling of
AsBroadcaster fails silently.

Table of Contents

Related product manuals