LOOPS

Loops:  loops create a repetitive action while a condition is met.  Then are great when you want to execute a segment of code an arbitrary number of times.  Anytime you have to count, you can use a loop to save on typing code.  This is a WHILE loop…

// While Loop

while (condition)
{
code to execute;
}

OR

var i:Number = 0;

while (i <= 10)
{
trace(i);
i++; // remember this is short hand for i=i+1
}

WHILE indicates we want to start a loop. 
x<=10 means CONTINUE the loop as long as x is less than or equal to 10.

// For Loop

for (initializer; condition; action){
code to execute;
}

OR

for (var i:Number = 0; i <= 10; i++) { 
    trace(i); 
}

For loop executes code block for a certain number of repetitions until the condition is met.