Instantiate a class from a string in ActionScript 3

后端 未结 2 1812
伪装坚强ぢ
伪装坚强ぢ 2021-01-13 13:40

I\'ve got a string which, in run-time, contains the name of a class that I want to instantiate. How would I do that?

I read suggestions to use flash.utils.getD

2条回答
  •  情歌与酒
    2021-01-13 14:03

    The other option is to use the mxmlc -includes compiler argument like this:

    -includes=com.mydomain.package.MyClass
    

    http://blogs.adobe.com/cantrell/archives/2010/09/loading-classes-dynamically-in-actionscript-3.html

提交回复
热议问题