AS3 Arrays: Array breakdown

var testArray:Array=new Array("name","address","state","zip","country");
//Naming the array variable

var testArray:Array=new Array("name","address","state","zip","country");
//Datatyping the variable as an Array

var testArray:Array=new Array("name","address","state","zip","country");
//Setting up a new array

var testArray:Array=new Array("name","address","state","zip","country");
//contents of the array. Each item is assigned a numerical index starting with 0. The example above would be (0,1,2,3,4).

AS3 If Statements: If, else if, and else breakdown

if (condition1) {
method;
} else if (condition2) {
method;
} else {
method;
}

//Conditions set by the programmer
//An "else if" will test to see if another condition is met
//If condition is met the methods within the curly braces will be performed
//Notice that "else" does not need a condition

Actionscript:

if (bButton.label==" Turn On" ) {
bButton.label=" Turn Off" ;
mcBulb.visible=true;

} else if (bButton.label==" Turn Off" ) {
bButton.label=" Turn On" ;
}

AS3 Loops: For Loop breakdown

for( init ; condition ; next ) {
method

}
//init counts how many times the loop is executed
//condition how far to count up too
//next is what we count by
//what you want to loop goes in here

Actionscript:

for (var i:Number=0; i < vExample; i++) {
tMessages.appendText([i]+" , " );
}

AS3 Loops: While Loop breakdown

init;
while( condition ) {
method

next;

}
//init counts how many times the loop is executed
//condition how far to count up too
//next is what we count by
//what you want to loop goes in here

Actionscript:

var i:Number=0;
while(i<10){
trace (testArray[i]);
i=i+1
}