Posted By

tuffstudio on 01/19/11


Tagged


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

burnandbass
kure69
onemanstudio
merritt212


Position Display Objects in a Grid Layout


 / Published in: ActionScript 3
 

  1. for (var i:uint = 0; i < 20; i++)
  2. {
  3. var displayObject:MyDisplayObject = new MyDisplayObject();
  4. displayObject.x = displayObject.width * ( i % 5 );
  5. displayObject.y = displayObject.height * Math.floor( i / 5 );
  6. addChild(displayObject);
  7. }

Report this snippet  

You need to login to post a comment.