Hey,
I am new to flash programming and am trying to create an empty 2D array.
I have the Code:
var squareList:Array = new Array(new Array());
Init();
function Init():void
{
var i:int, j:int;
squareList = new Array(15);
for(i=0; i<15; i++)
{
squareList* = new Array(10);
for(j=0; j<10; j++)
{
squareList*[j] = null;
}
}
}
function CanMoveDown():Boolean
{
if( squareList[currentSquare.y - 1][currentSquare.x] == null )
{
return true;
}
return false;
}
The function CanMoveDown() is called on each tick but im getting the error:
TypeError: Error #1010: A term is undefined and has no properties
I want the list to be empty but im not sure why i can not compare it to null.
Any suggestions? Im completely lost