Mega Code Archive

 
Categories / Flash ActionScript / Statement
 

The for Statement

package{   import flash.display.Sprite;      public class Main extends Sprite{     public function Main(){         var total = 2;                  for (var i = 0; i < 2; i++) {           total = total * 2;         }                  //here's the equivalent while loop:         var total = 2;         var i = 0;                  while (i < 2) {           total = total * 2;           i++;         }     }   } }