hi
maybe a silly question, but here i go anyway:
how would you write something like this in actionscript:
int matrix[3][3];
for(i=0;i3;i++)
for(j=0;j3;j++)
matrix[i][j]=0;
i've done something like this in my code, mtasc doesnt complained, but
the program doesnt work, and i have a feeling
On Oct 31, 2005, at 7:22 AM, cornel wrote:
hi
maybe a silly question, but here i go anyway:
how would you write something like this in actionscript:
int matrix[3][3];
for(i=0;i3;i++)
for(j=0;j3;j++)
matrix[i][j]=0;
i've done something like this in my code, mtasc doesnt complained, but
int matrix[3][3];
for(i=0;i3;i++)
for(j=0;j3;j++)
matrix[i][j]=0;
You have to create the initial array and then create any sub array. Kinda
like:
matrix = [];
for(i=0;i3;i++) {
matrix[i] = [];
for(j=0;j3;j++) {
matrix[i][j] = 0;
}
}
You must create empty arrays first, like this:
// bidimensional array in AS
var matrix2:Array = [];
for(i=0;i3;i++){
matrix2[i] = [];
for(j=0;j3;j++){
matrix2[i][j]=0;
}
}
trace(matrix2);
-- original message --
On Oct 31, 2005, at 7:22 AM, cornel wrote:
hi
On Oct 31, 2005, at 9:24 AM, Gregory wrote:
You must create empty arrays first, like this:
// bidimensional array in AS
var matrix2:Array = [];
for(i=0;i3;i++){
matrix2[i] = [];
for(j=0;j3;j++){
matrix2[i][j]=0;
}
}
trace(matrix2);
Yea, I'm a dufus. I
5 matches
Mail list logo