MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 245

Actionscript language reference
Table of Contents

Advertisement

my_array[9] = 'c';
trace(my_array.length); // my_array.length is updated to 10
trace(my_array);
// displays:
// a,b,undefined,undefined,undefined,undefined,undefined,undefined,undefined,c
// if the length property is now set to 5, the array will be truncated
my_array.length = 5;
trace(my_array.length); // my_array.length is updated to 5
trace(my_array); // outputs: a,b,undefined,undefined,undefined
Array.pop()
Availability
Flash Player 5.
Usage
my_array.pop() : Object
Parameters
None.
Returns
The value of the last element in the specified array.
Description
Method; removes the last element from an array and returns the value of that element.
Example
The following code creates the
its last element:
var myPets_array:Array = new Array("cat", "dog", "bird", "fish");
var popped:Object = myPets_array.pop();
trace(popped); // displays fish
trace(myPets_array); // displays cat,dog,bird
See Also
,
Array.push()
Array.push()
Availability
Flash Player 5.
Usage
my_array.push(value,...) : Number
Parameters
One or more values to append to the array.
value
myPets_array
,
Array.shift()
Array.unshift()
array containing four elements, and then removes
Array.push()
245

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex

Table of Contents