AS3 Loops: Simple "while" loop

var i:Number= 0;

while (i < 5) {
i = i+1;

AS3 Loops: Simple "for" loop

for (var i:Number=0; i < 5; i++) {

AS3 Arrays: Access elements in a string array

//String array


var aString:Array = new Array ("Name", "Address", "State", "Zip", "Phone");
//returns the contents of the array
//trace the position of an object in an array. Index position must be in brackets. This trace would return "address".
//returns the length of the array. This trace would return "5"

Programming Habits: Using Trace Statements

Trace Statements

Its a great practice to utilize the trace statements if you arent already. A trace statement is used by programmers to test functionality or debug their script. The trace statement IS NOT seen once your swf has been published for the web or viewed outside of flash. Meaning no one will see it when viewing your flash project online. This is the primary reason my flash notes all include a dynamic text box. Normally I would just use a trace statement, but if I did that users would be unable see to the the result of given example. Furthermore, it might better suit you to skip making a dynamic textbox and just use a trace command.


trace("this is a simple trace statement");