For+Loops

code format="actionscript3" var i:Number; i = 0; while (i<5) {   trace(i+ ". Hello!"); i = i + 1; } trace ("Goodbye."); code
 * Here is an example of a while loop:**
 * Insert a code block (Pick "Widget"...."Insert Code"..."Actionscript 3" from the editing bar) that has the equivalent statement, using a "For Loop."**

code format="actionscript3" var i:number for (i=0;i<46;i=i+1) {  temp=new BoxMC; grid.push(temp); temp.x=12*i+6; temp.y=12*j+4; addChild(temp); temp.setPhase(Math.sqrt(i*i+j*j)); } code

First is setting the intial condition for variable: so if you want to have var i start at 0 you say (i=0;...) the second is the condition or parameters that the variable must stay in. So if your number is bigger than 46 than the computer will skip the for loop third is what you want the for loop to do each time it passes over it. So if you want to have your variable get bigger by one each time just say i++.
 * The "for" command has three things in parentheses, separated by semicolons. What does each of these three things mean, and when does the computer do them?**

It does nothing and just skips right over everything in the bracket.
 * If the condition in the "for" loop is false when the computer first gets to the 'for" command, does it execute the contents of the curly bracket? If not, what happens?**