Monday, September 17, 2018

Creating an Array in actionscript3

ad300
Advertisement

Creating an Array

There are a number of methods for creating an array. You can use the same instantiation method used for other AS3 classes by using the new keyword with the class name, and have the contents of you array passed as values between the brackets, as shown in the example code below:
var myArray:Array = new Array("Flash", "ActionScript", "Republic of Code");
Alternatively, ActionScript allows you to use a shorter technique by using the square brackets [] to automatically instantiate an array:
var myArray:Array = ["Flash", "ActionScript", "Republic of Code"];
Both of these codes create the same exact thing. Most developers tend to use the shorthand method though.
Share This
Previous Post
Next Post

Pellentesque vitae lectus in mauris sollicitudin ornare sit amet eget ligula. Donec pharetra, arcu eu consectetur semper, est nulla sodales risus, vel efficitur orci justo quis tellus. Phasellus sit amet est pharetra

0 comments:

Ad Section2

Sponsor

Ad Section