Continuing my series of posts of interesting, but not too useful ActionScript tips (which I learned from studying Objective-C), did you know that you don’t have to initialize your counter variable within a for loop.
For example, this is perfectly valid:
package { import flash.display.Sprite; public class LoopTest extends Sprite { public function LoopTest() { var i:int = 0; for(; i < 5; i++) { trace(i); } } } } As you can see, the variable is initialized outside of the loop.