This example will give you the error you got, because Green is a string:
var myArray:Array = new Array("Green");
var objClass:Class = myArray[0] as Class;
var objisplayObjectContainer = new objClass() as DisplayObjectContainer;
addChild(obj);
Changing the first line will correct the mistake:
var myArray:Array = new Array(Green);
Probably the array members are all strings.




isplayObjectContainer = new objClass() as DisplayObjectContainer;
Reply With Quote
