import SWFKit.*;
var sh = new ScriptHost;
sh.open("perlscript");
sh.runScriptFile("c:\\test.pl");
sh.close();
sh.open("jscript");
sh.runScript("function add(a, b) {return a + b;}");
var ax = ActiveXObject.fromID(sh.getScriptObject());
var value = ax.callMethod("add", "Hello,", "world");
_root.strace(value);
sh.Release();
As you can see from the above code, the "getScriptObject" method returns
an ActiveXObject object, which contains the global functions and variables
in the running script.