Archive for the 'MTASC vs FlashIDE' Category

Casting to Array

Friday, November 16th, 2007

Casting to Array, well that’s easy enough right?

Imagine you have:
var my2dArray:Array = new Array();

my2dArray.push ([1,2,3,4,5]);
my2dArray.push ([6,7,8,9,0]);

And now you want to access and cast an element of myArray to an array:

var firstArray:Array = Array (my2dArray[0]);
trace (firstArray.length);

Right?

Yeah if you’re compiling in MTASC. The Flash IDE (more…)