Randomly arranged grid from single loop
Hi there,
I have the following code with which I am creating a grid.. what I need to do is, either create the grid in a random order at the beginning, or 'shuffle' the grid once it has been created.. meaning each time I load the page the order is changed.. is this possible ?? Thanks in advance for any response ![]()
for (var i:uint = 0; i< boxNum; i++) {
var animatedButton = new AnimatedButton();
animatedButton.x = animatedButton.width * (i % cols);
animatedButton.y = animatedButton.height * int(i / cols);
grid.addChild(animatedButton).name = "m" + (i + 1);
}