Parameters
numElements:Number
the array. You can specify either
[optional] - One or more parameters,
elementN:Object
, the values of which can be of any type. Parameters that can accept more than one
elementN
data type are listed as type
elements, but not both.
Returns
- An array.
Array
Example
var myArray:Array = Array();
myArray.push(12);
trace(myArray); //traces 12
myArray[4] = 7;
trace(myArray); //traces 12,undefined,undefined,undefined,7
Usage 2: The following example creates an array of length 4 but with no elements defined:
var myArray:Array = Array(4);
trace(myArray.length); // traces 4
trace(myArray); // traces undefined,undefined,undefined,undefined
Usage 3: The following example creates an array with three defined elements:
var myArray:Array = Array("firstElement", "secondElement", "thirdElement");
trace (myArray); // traces firstElement,secondElement,thirdElement
Unlike the Array class constructor, the Array() function does not use the
keyword new .
See also
Array
asfunction protocol
asfunction:function:Function, parameter:String
A special protocol for URLs in HTML text fields that allows an HREF link to call an
ActionScript function. In HTML text fields, you can create links using the HTML
HREF attribute of the
HTTPS, or FTP. The
which causes the link to invoke an ActionScript function.
Availability: ActionScript 1.0; Flash Player 5
46
ActionScript language elements
[optional] - A positive integer that specifies the number of elements in
numElements
. You can specify either numElements or the list of
Object
tag contains a URL that uses a standard protocol such as HTTP,
A
protocol is an additional protocol that is specific to Flash,
asfunction
or the list of elements, but not both.
element0, element1, ... ,
tag. The
A
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?