This code is meant to place an instance of a movieclip called BasicGrid on to my stage 25 times, then if the X co-ordinate of the new movieclip is over 128 it starts placing them on a new line.
But for some reason I can't get it to work no matter what I try, all it does is place 25 squares in the exact same position, any advice/help would be appreciated, thanks!
for (var i:uint; i <= 25; i++) {
var newOpenGrid:BasicGrid = new BasicGrid();
newOpenGrid.x + 32;
if(newOpenGrid.x > 128) {
newOpenGrid.x = 32;
newOpenGrid.y += 32;
}
addChild(newOpenGrid);
trace(this.numChildren);
trace("X: " + newOpenGrid.x);
trace("Y: " + newOpenGrid.y);
trace("i: " + i);
}