MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual page 278

Actionscript reference guide
Hide thumbs Also See for FLASH MX 2004 - ACTIONSCRIPT:
Table of Contents

Advertisement

Array.length
Availability
Flash Player 5.
Usage
my_array.length
Description
Property; a nonzero-based integer specifying the number of elements in the array. This property is
automatically updated when new elements are added to the array. When you assign a value to an
array element (for example,
greater than the
Example
The following code explains how the
my_array = new Array();
trace(my_array.length); // initial length is 0
my_array[0] = 'a';
trace(my_array.length); // my_array.length is updated to 1
my_array[1] = 'b';
trace(my_array.length); // my_array.length is updated to 2
my_array[9] = 'c';
trace(my_array.length); // my_array.length is updated to 10
Array.pop()
Availability
Flash Player 5.
Usage
my_array.pop()
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
last element.
myPets = ["cat", "dog", "bird", "fish"];
popped = myPets.pop();
trace(popped);
// returns fish
278
Chapter 12: ActionScript Dictionary
my_array[index] = value
property, the
length
length
length
myPets
), if
index
property is updated to
property is updated.
array containing four elements, then removes its
is a number, and
index+1
.
index+1
is

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Table of Contents