Labelling your For-loops in AS3


/ Published in: ActionScript 3
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.