All posts tagged for

AS3 loops performance benchmarking

I just went through a post from polygonal labs that shows the difference in performance between several loops in AS3. If you go have a look at his post, you’ll see that the “for (i = 0; i < n; i++) {}” loop wins the first place. I have set up a benchmarking tool just […]

The continue statement and labels

The continue statement skips the rest of the code inside a loop and starts at the beginning of this loop as if the end of the loop had been reached normally. Thus, the code after the continue statement in the code below will never get executed by flash: [sourcecode language=’cpp’] for(var i:int = 0 ; […]

Break statement and labels

The break statement allows us to skip the execution of a loop or statement: [sourcecode language=’cpp’] for(var i:int = 0 ; i < 10 ; i++) { if ( i >= 5 ) { break; } } [/sourcecode] Simple. Now imagine we have a loop nested in another loop: [sourcecode language=’cpp’] for(var i:int = 0 […]