don simon
07-17-2006, 04:54 PM
Hi,
I wanna make a 2D array to hold six x and y values, i.e. 6x2 values from posArray[0][0] to posArray[5][1]. How can I define it without adding values?
I tried using
var posArray:Array = new Array([],[]);
but it only creates a 2x2 array. It works fine reading/writing to all positions using this:
var posArray:Array = new Array([00, 01],[10, 11],[20, 21],[30, 31],[40, 41],[50, 51]);
but it's quite ugly programming adding all those numbers that aren't to be used.
This should be quite basic, but I can't seem to find the correct syntax... :confused:
I wanna make a 2D array to hold six x and y values, i.e. 6x2 values from posArray[0][0] to posArray[5][1]. How can I define it without adding values?
I tried using
var posArray:Array = new Array([],[]);
but it only creates a 2x2 array. It works fine reading/writing to all positions using this:
var posArray:Array = new Array([00, 01],[10, 11],[20, 21],[30, 31],[40, 41],[50, 51]);
but it's quite ugly programming adding all those numbers that aren't to be used.
This should be quite basic, but I can't seem to find the correct syntax... :confused: