How can I initialise two-dimentional typed Vector is AS3?
Now I can get working only this:
private var _mainArray : Array = new Array( MyConst.DIMENTION );
public function MyArray()
{
for ( var i : int = 0; i < MyConst.DIMENTION; i++ ) {
_mainArray[ i ] = new Vector.<int>( MyConst.DIMENTION );
}
}
...
_mainArray[ i ][ j ] = 0;
What you have is an Array of Vector of int. What you want is a Vector of Vector of int.
So your “outer” Vector has to declare that contains elements of type
Vector.<int>Something like this (of course you can use a for loop):