blog
Quick Tip: Labeling Loops at Jozef Chúťka's blog
August 26, 2010
break for for each label loops while
Quick Tip: Labeling Loops
Did you know you can label loops in ActionScript 3? Yes, you can! I got inspired by latest tweets referencing source code in image. Lets do some small experiments… Label all of them:
var a:uint, b:uint = 0;
loopA:for(a = 0; a < 10; a++)
loopB:while(b++ < 100)
loopC:for each(var c:uint in [0,1,2,3])
break loopB;
trace(a, b, c); // traces "10 10 0"Where to go from here
See it in action on wonderfl.net
You may Leave a comment or Subscribe to Comments RSS or Trackback this entry.
1 comment so far
PSturgeon August 26, 2010 22:31 OMG! That is freakin amazing. I had no idea. That is definitely going to come in handy with nested loops.
Leave a comment
Please be polite and on topic. Your e-mail will never be published.