Monday, June 20, 2005

Flash: Casting an Object to an Array

In Flash, it's impossible to cast an Object to an Array because of the existence of the global Array() function. Instead the Array has to be recreated manually:
var myArray:Array = new Array();

for(var i=0;i < myObj.length;i++) {
myArray[i] = myObj[i];
}

0 Comments:

Post a Comment

<< Home