I’ve been tested for a day. it gaves me errors always. But i guess, there is nothing wrong for code. What i did is this.
//!------------------------------------------------------------------------------------------------
class MALLOCK {
private var WIDTH : int = 10 + 1; // width of board
private var HEIGHT : int = 20 + 1; // height of board
function MALLOCK() {
position = new _blockModuler();
block = new GameObject[4];
block[0] = block[1] = block[2] = block[3] = null;
aiCheckBoard = new int[WIDTH * HEIGHT];
if(aiCheckBoard == null)
Debug.Log(“allocation is something wrong.”);
for(var i : int = 0; i < WIDTH * HEIGHT; i++) {
aiCheckBoard = 0;
-
}*
-
Debug.Log(“allocation is done.”);*
-
}*
-
var aiCheckBoard : int[ ]; // check board;*
-
var position : _blockModuler;*
-
var block : GameObject[ ];*
};
then i used it outside as
for(var i : int = 0; i < 10; i++) {
Debug.Log("board: " + __alloc.aiCheckBoard[0] );
}
It always said that message as i posted.
IndexOutOfRangeException: Array index is out of range.
Did i something missed?
Thanks.