Posted By

weavermedia on 07/06/09


Tagged

loop for as3


Versions (?)

Who likes this?

10 people have marked this snippet as a favorite

weavermedia
pauloc
bazjapan
volvis
iamgowan
TrentSkunk
zoo
AttackingHobo
onemanstudio
letmein_xxi


Fast loop iteration


 / Published in: ActionScript 3
 

URL: http://www.calypso88.com/?p=174

  1. // fastest way to iterate through a loop
  2. // - set var to :int
  3. // - count down from desired loop count to zero
  4. // - on each count we test the Boolean value of j (j<1 makes it false)
  5. // - instead of counting down with j-- we use j += -1 because adding negative
  6. // numbers is faster than subtracting
  7. //
  8.  
  9. for(var j:int=10; j; j += -1){}

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: KDR on October 7, 2009

cool!

You need to login to post a comment.