hello
I’m having a problem trying to use the method getDefinitionByName, I am using an array to store the names of the classes, the problem that arises is that when I am touring the settlement to create instances of classes shows me that error variable is not set, I’ve already created an instance of the classes that are in the array so the problem should not be because of this issue, only allows me to create the instance of an object in the array and when you try to create the following instance shows me the error that I mentioned previously
the fix that I’m using has these variables
“PlataformaPrueba”, “PlataformaPrueba2”
and code with which I’m reading it:
var className: String;
var classReference: Class;
var classReference1: Class;
var VisualObject: DisplayObject;
var visualObject2: DisplayObject;
var indexOfAssets: Number = 0;
var string: String;
for (var i: Number = 0; i <= assetsList.length; i + +)
(
string = assetsList.pop (). toString ();
getDefinitionByName classReference = (string) as Class;
classReference VisualObject = new ();
visualObject.x = (10);
visualObject.y = 10 + (60 * indexOfAssets)
addChild (VisualObject)
assetsList.push (VisualObject)
indexOfAssets + +;
)
I appreciate any help on this topic because i am really stuck, thanks