Array.shift() - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

Array.shift()

Availability
Flash Player 5.
Usage
my_array.shift() : Object
Parameters
None.
Returns
The first element in an array.
Description
Method; removes the first element from an array and returns that element.
Example
The following code creates the array
array and assigns it to the variable
var myPets_array:Array = new Array("cat", "dog", "bird", "fish");
var shifted:String = myPets_array.shift();
trace(shifted); // displays "cat"
trace(myPets_array); // displays dog,bird,fish
See also
Array.pop(), Array.push(),
112
Chapter 2: ActionScript Language Reference
myPets_array
:
shifted
Array.unshift()
and then removes the first element from the

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents