|
|||
|
Hi guys:
I have some problems with ruby and ScriptHost, I try this: var scriptHost = new ScriptHost; scriptHost.open("rubyscript"); scriptHost.runScriptFile("c:\\test.rb"); var so = scriptHost.getScriptObject(); // so is an ActiveX object trace(so); // get the value of the "x" variable var t = so.x; trace(t); // the result is "hello world" // call the _add function t = so._add(1, 2); trace(t); // the result is "3" and my rubyscript is (C:\test.rb): def _add(a, b) #puts a + b return a + b end x = _add("hello", " world") and I get this in the ouput: FSCommand("FFish_Run", "Initialize") [object ActiveXObject] Warning: using undefined property "x" Warning: using undefined variable "t" undefined Warning: unknown method "_add" Warning: using undefined variable "t" undefined As you can see, the ruby script is the same as the javascript example: function _add(a, b) { return a + b; } x = _add("hello", " world"); but I don't now what is wrong with the ruby part, I just download Ruby 1.8.5 One-Click Installer from http://www.ruby-lang.org/ Does anyone try ruby with ScriptHost object? Thanks a lot in advance! Olvaid |
|
|||
|
In fact ruby code is executed, but the returning ActiveXObject with the methods and vars is empty
var shOpen = scriptHost.open("rubyscript"); return true var shRun = scriptHost.runScriptFile("c:\\test.rb"); also return true any clue in this topic will be very appreciated... |
|
|||
|
We have not found out the reason of the problem yet, so we cannot tell you how to resolve it right now. However, we will keep working on it, and we will post the resolution at here immediately after we have worked it out.
|
|
|||
|
The problem is that the ruby activexscript engine does not provide the ITypeInfo interface so that the ffish scripting language cannot call methods and properties of the "so" object. Please wait for swfkit pro 3.1, in which we will resolve this problem.
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|