[COLOR=black][FONT=Arial]In as simple an example as I can think of, I have two classes: Dog and Cat. Both are subclasses of Animal, in this stupid example…[/FONT][/COLOR]
[COLOR=black][FONT=Arial]I know how to create instances of both, however I don’t know how to dynamically create them by name from a string.[/FONT][/COLOR]
[COLOR=black][FONT=Arial]It would be something like…[/FONT][/COLOR]
[COLOR=black][FONT=Arial]function addAnimal( type:String ):Animal {[/FONT][/COLOR]
[COLOR=black][FONT=Arial]return new type;[/FONT][/COLOR]
[COLOR=black][FONT=Arial]}[/FONT][/COLOR]
[COLOR=black][FONT=Arial]Thanks in advance.[/FONT][/COLOR]