EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE - Unshift (Array.unshift Method); Boolean

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE
780 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...
268 ActionScript classes
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 Lite 2.0
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)
Boolean
Object
|
+-Boolean
public class Boolean
extends Object
The Boolean class is a wrapper object with the same functionality as the standard JavaScript
Boolean object. Use the Boolean class to retrieve the primitive data type or string
representation of a Boolean object.
You must use the constructor new
Boolean() to create a Boolean object before calling its
methods.
Availability: ActionScript 1.0; Flash Lite 2.0 - (became a native object in Flash Player 6,
which improved performance significantly)

Table of Contents

Related product manuals