Use for loop statement to display all elements in an array
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
var myArray:Array = ["A", "B", "C", "D", "E", "F", "G"];
for (var i:int = 0; i < myArray.length; i++) {
trace("Hello, " + myArray[i] + "!");
}
}
}
}
Related examples in the same category