How to load and access neko module using strings

24 views
Skip to first unread message

Travis Paxton

unread,
Jan 13, 2014, 10:25:17 AM1/13/14
to haxe...@googlegroups.com
I'm trying to figure out how to load and use a neko module using just a string. For instance, if you had a list of modules in a database or config file.

For example, I can load the module from a string, but I have to explicitly define the class name when I create the instance.

var module = neko.vm.Loader.local().loadModule("HelloWorld");
var classes = module.exportsTable().__classes;
var instance = Type.createInstance(classes.HelloWorld, []);

Ideally, there'd be a way to do something like:

var instance = Type.createInstance("HelloWorld", []);


Reply all
Reply to author
Forward
0 new messages