Loading an Array
Flash CS4 ActionScript 3.0 Tutorial
How to Load Data into an Array Variable
Arrays are used to organize large amounts of data. Arrays can be described as multi-dimensional variables that can hold several values. There are multiple ways to assign array values.
In this example we will demonstrate two ways to load an Array variable with data.
Open a new Flash document and name the default layer Actions.
Option double-click (PC - Alt double-click) frame one of the Actions layer.
Copy/Paste the following code to the ActionScript panel.
var boxColor01:Array = new Array("Red01", "Green01", "Blue01");
var boxColor02:Array = new Array;
trace(boxColor01 + boxColor01 + boxColor01);
trace(boxColor02 + boxColor02 + boxColor02);
Publish your movie by pressing Cmd/Return (PC - Ctrl/Enter). The values of each Array is displayed in the Output panel. The top line shows the boxColor01 contents and the second line displays the boxColor02 Array.
Dissecting the Code
The first line of the code at Step Three establishes a new variable named boxColor01. For the boxColor01 variable, Red01 is loaded in slot , Green01 is in slot  and Blue01 is loaded in slot .
The next line of the code establishes a new variable named boxColor02. For the boxColor02 variable, Red02 is loaded in slot , Green02 is in slot  and Blue02 is loaded in slot .
To see the contents of both Arrays, we added a trace statement. Both methods work when loading an Array. The first method is more compact.