For a HTML5 project I have a bunch of images stored in a SWF file. Each one is linked to a class name. They are not in any symbol so they do not have instance names, which means I cannot use Relect.field.
In Flash actionscript I could get an image by class name using the following:
private function getImage(imageClassName:String):Sprite
var image:Sprite = null; var imageClass:Class = getDefinitionByName(imageClassName) as Class; if (imageClass != null ) image = new imageClass() as Sprite; return(image);
I researched this online but any solution I found I didn’t understand or was overly complicated, usually assuming that the constructor for the desired class would need parameters passed, etc.
What is the equivalent function in OpenFL/Haxe?
Thanks in advance!