Running into a weird issue - wonder if anyone can help. I am creating a grid of tiles for a game and pushing them all into a 2D array for easy access later. This works fine when I test in the simulator, but when I test on the device, the array _arenaArray is empty. I thought I might be doing it wrong by clearing out the rowArray each time I've added it to the _arenaArray, but as it worked in the simulator... so weird! Any help would be appreciated!
_arenaArray = new Array();
var rowArray:Array = new Array();
var i:int;
var ft:FloorTile;
var xPos:Number = 0;
var yPos:Number = 0;
var row:int = 0;
var column:int = 0;
for(i = 0; i<_gridSize*_gridSize; ++i)
{
ft = new FloorTile();
ft.x = xPos;
ft.y = yPos;
ft.row = row;
ft.column = column;
addChild(ft);
rowArray.push(ft);
xPos = xPos + ft.width;
++column;
if(xPos == ft.width*_gridSize)
{
xPos = 0;
yPos = yPos + ft.height;
column = 0;
++row;
_arenaArray.push(rowArray);
rowArray = new Array();
}
}