Mega Code Archive

 
Categories / Flash ActionScript / Array
 

If you assign a value to an element that has not yet been created, actionscript creates that element, and any other elements with in

package{   import flash.display.Sprite;      public class Main extends Sprite{     public function Main(){         var aEmployees:Array = new Array(4);         aEmployees[0] = "A";         aEmployees[1] = "P";         aEmployees[2] = "C";         aEmployees[3] = "H";                  aEmployees[9] = "Ruth";                           trace(aEmployees.toString());  //A,P,C,H,,,,,,Ruth     }   } }