Posted By

JaaQ on 02/03/11


Tagged

actionscript loop label for as3


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

weavermedia
letmein_xxi


Labelling your For-loops in AS3


 / Published in: ActionScript 3
 

Give your for-loops a label so you can break them individually

  1. var a:uint, b:uint = 0;
  2. loopA:for(a = 0; a < 10; a++)
  3. loopB:while(b++ < 100)
  4. loopC:for each(var c:uint in [0,1,2,3])
  5. break loopB;
  6.  
  7. trace(a, b, c); // traces "10 10 0"

Report this snippet  

You need to login to post a comment.