Posted By

ramsesz on 05/30/13


Tagged

grid


Versions (?)

Grids in 2 lines of Code


 / Published in: ActionScript 3
 

URL: http://www.ramsesz.be

This is a way to make grids in 2 lines of code

  1. var cols:int = 2;
  2. height:int = 20;
  3. width:int = 40;
  4.  
  5. for (var i:int = 0;i<20;i++) {
  6. var clip:MovieClip = new MovieClip();
  7. clip.y = (Math.floor(counter/cols) * height);
  8. clip.x = (counter%cols * width);
  9. }

Report this snippet  

You need to login to post a comment.