nutcase88
October 8th, 2007, 01:23 AM
Hi im trying to create a 2d array in flash and the fact that im a C++ programmer isnt helping me so im a little lost here.
Ive searched the forums and found something like this
var urls:Array=new Array();
for(i=0;i<3;i++)
{
urls[i] = new Array();
for(k=0;k<3;k++)
{
trace(urls[i][k]);
}
}
However when i put it in the trace returns undefined.
I am looking to create something like a 14 x 14 2D grid where all the variables inside are 0 at the beginning.
I did something like so
myArray = newArray();
for(int i =0; i< 14;i++){
for(int k =0; k< 14;k++){
myArray[i][k] =0;
}
}
But unfortunately it doesnt work.
Please advise, thanks in adv!
Ive searched the forums and found something like this
var urls:Array=new Array();
for(i=0;i<3;i++)
{
urls[i] = new Array();
for(k=0;k<3;k++)
{
trace(urls[i][k]);
}
}
However when i put it in the trace returns undefined.
I am looking to create something like a 14 x 14 2D grid where all the variables inside are 0 at the beginning.
I did something like so
myArray = newArray();
for(int i =0; i< 14;i++){
for(int k =0; k< 14;k++){
myArray[i][k] =0;
}
}
But unfortunately it doesnt work.
Please advise, thanks in adv!