Return to Snippet

Revision: 14401
at June 2, 2009 20:04 by StrawMan


Initial Code
var numOfColumns:int = 5;
var spacer:int = 10;

for(var i:int; i < 10; i++) {
     var item:ItemToAdd = new ItemToAdd();
     item.x = (i % numOfColumns) * (item.width + spacer);
     item.y = Math.floor(i / numOfColumns) * (item.height + spacer);
     addChild(item);
}

Initial URL
http://www.davidpett.com/actionscript-3-dynamic-rows-and-columns/

Initial Description
Care of David Pett. 
See link.

Initial Title
Dynamic Columns & Rows

Initial Tags

                                

Initial Language
ActionScript 3