[AS 2.0 Help] arrays with two rows

I’m using AS 2.0 - Can anyone point me to some info on using matrices?

I want to store sets of points in an array like so:

arrP = [[0,0],[50,0],[50,50],[0,50]];

How would I declare an array like that? And do I access it the same way as any other programming language? Ex: if(arrP[0][0] == 0)

The way I’m using it now I just declare var arrP = new Array(); Not sure if that works for a two dimensional array as well.

And for accessing/altering I’m using arrP*[0] or arrP*[1].

I’m pretty sure my problem is with the declaration.

In AS2 you can use arrays to store matrices.

For example…


var arrP:Array = new Array();
arrP = [[0,0],[50,0],[50,50],[0,50]];

arrP[0][0] = -1;
arrP[3][1] = 1000;

for(var a:Number = 0; a < arrP.length; a++)  {
	for(var b:Number = 0; b < arrP[a].length; b++)  {
		trace(arrP[a]**);
	}
}