In ActionScript, an array is actually an object. (In Chapter 6, "Objects: Critter Attack ," we'll look at objects in great detail.) To use an array, the first thing we must do is create one. Look at the following code that creates a new array:
myArray = new Array();
This line of script begins with a new variable declaration: myArray . From there, this new reference is assigned a value of new Array() . All this does is create a new array object and assign it to the reference myArray . The parentheses following the object name are for constructors, and we'll talk about those in Chapter 6 as well. For now, just realize that the preceding script creates a new array for our use.
Caution | The keyword new is reserved in Flash. Its sole purpose is object instantiation. |