function loadHost()
{
try {
// ...
var source = File.getBytes(HOST_SCRIPT);
var module = Module.fromData(source.getData());
if (module != null) {
// ...
trace("calling createUI() for instance of " + HOST_SCRIPT);
host_ui = host.createUI();
trace("adding UI for " + HOST_SCRIPT);
host_ui_container.addChild(host_ui);
} else {
trace("ERROR: host script '" + HOST_SCRIPT + "' failed to load");
}
} catch (e:Exception) {
trace("ERROR: loadHost()");
showError(e);
}
}
function showError(e:Exception) {
trace("!!!!!!!!!!!!!ERROR!!!!!!!!!!!!!");
var m = "exception: " + e;
if (e != null) {
m += "\n\nmessage: ";
m += Std.string(e.message);
m += "\n\nnative: ";
m += Std.string(e.native);
m += "\n\ndetails: ";
m += Std.string(e.details());
m += "\n\nstack: ";
m += Std.string(e.stack);
}
trace(m);
// show the contents of `m` on-screen via Label gui component
with debug build