Ciao a tutti!
Vorrei provare a istanziare dei DisplayObject a partire dai nomi delle classi presenti su un array.
codice:
import flash.utils.getDefinitionByName;
....
var ClassReference:Class = getDefinitionByName("app.MioPackage.PincoPallo") as Class;
var myPincoPallo:Object = new ClassReference();
fin qui tutto bene. Il problema è che quando tento di fare l'addChild mi trovo di fronte l'errore 1118. "Implicit coercion of a value with static type Object to a possibly unrelated type DisplayObject"
Ho provato allora a fare così
codice:
if(myPincoPallo is DisplayObject) addChild(myPincoPallo);
Ovviamente non funziona.
Avete qualche idea?
resto in ascolto!