I'm getting crazy with arrays so I need your help:
I created a couple of nested arrays:
private var mainArray:Array=[arrayOne,arrayTwo,arrayThree];
private var arrayOne=[item1,item2,item3];
private var arrayTwo=[item4,item5,item6];
private var arrayThree=[item7,item8,item9];
First, when I try for example: trace(mainArray[2][0]) Flash Builder's output is: undefined or null (instead of item7).
Second, I'm not able to find any row/col position (obviously...because every object seems to be undefined):
private function findPosition(row:int,col:int)
{
for(var row:int=0;row<=mainArray.length;row++)
{
for(var col:int=0;col<=mainArray[row].length;col++
{
trace(row,col,mainArray[row][col]);
}
}
}
It always throws me some type of error (I tryied many self-made solutions and google searches).
I need to find every row/col position and place artworks according to it, I'm creating a tile map, and this may be the simplest way for me(beginner).
Thanks for every possible solution.