Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-15-2007, 01:12 PM
Junior Member
 
Join Date: Feb 2007
Posts: 7
Default ScriptHost and RubyScript

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

Reply With Quote
  #2 (permalink)  
Old 02-17-2007, 01:33 AM
Junior Member
 
Join Date: Feb 2007
Posts: 7
Default Re:ScriptHost and RubyScript

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...
Reply With Quote
  #3 (permalink)  
Old 02-17-2007, 03:03 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:ScriptHost and RubyScript

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.
Reply With Quote
  #4 (permalink)  
Old 02-17-2007, 05:56 AM
Junior Member
 
Join Date: Feb 2007
Posts: 7
Default Re:ScriptHost and RubyScript

Thanks a lot, I'm be waiting...
Reply With Quote
  #5 (permalink)  
Old 02-20-2007, 02:19 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:ScriptHost and RubyScript

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.
Reply With Quote
  #6 (permalink)  
Old 02-20-2007, 10:08 PM
Junior Member
 
Join Date: Feb 2007
Posts: 7
Default Re:ScriptHost and RubyScript

Thanks a lot, I'm be waiting
You have an idea of when is the release version of 3.1?
Reply With Quote
  #7 (permalink)  
Old 02-26-2007, 12:41 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:ScriptHost and RubyScript

We will send you the patch files at tomorrow.
Reply With Quote
  #8 (permalink)  
Old 02-27-2007, 12:26 AM
Junior Member
 
Join Date: Feb 2007
Posts: 7
Default Re:ScriptHost and RubyScript

Thanks a lot guys!
Reply With Quote
  #9 (permalink)  
Old 02-27-2007, 09:47 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:ScriptHost and RubyScript

We've sent an email to your email box @gmail, please check email.
Reply With Quote
  #10 (permalink)  
Old 02-27-2007, 11:23 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:ScriptHost and RubyScript

We cannot send the patch to your email box @gmail. Please send us an email (support@swfkit.com) with your another email box. We will reply your emaill with the patch files.
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:06 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.