// This code should be placed in a for loop of some sort
// that iterates through each of your images or display objects.
//
if(iNum==0) {
// place the first image at 0,0
currX = 0;
currY = 0;
} else if(iNum%2 == 0) {
// Change "2" to however many columns this grid should have.
// This runs anytime iNum is evenly divisible by 2
// Which sets currX to 0 and adds another row height to currY
// Essentially starting a new row.
currY += _imageHeight + _imageSpacing;
currX = 0;
} else {
currX += _imageWidth + _imageSpacing;
}
images[i].x = currX;
images[i].y = currY;