/ Published in: ActionScript 3
Care of David Pett.
See link.
See link.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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); }
URL: http://www.davidpett.com/actionscript-3-dynamic-rows-and-columns/