[Flashcoders] bidimensional array in as

2005-10-31 Thread cornel
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

Re: [Flashcoders] bidimensional array in as

2005-10-31 Thread Jon Bradley
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

Re: [Flashcoders] bidimensional array in as

2005-10-31 Thread Zeh Fernando
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; } }

Re: [Flashcoders] bidimensional array in as

2005-10-31 Thread Gregory
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

Re: [Flashcoders] bidimensional array in as

2005-10-31 Thread Jon Bradley
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