Using win32ole to access the Flash ExternalInterface API?

Discussion in 'Ruby' started by Peter Motzfeldt, Feb 28, 2007.

  1. Hi

    I am working on a master thesis at Norwegian University of Science and
    Technology, and I am trying to create a open source framework for
    functional testing of Flex applications. And I want to do it in Ruby.

    I am playing with the ExternalInterface API for Flash applications. With
    this API it is possible to define methods, which will be visible through
    activex.

    This is shown in the example in the link below
    http://livedocs.adobe.com/flex/201/...k_Parts&file=19_External_Interface_178_5.html


    This example uses C#, but I was thinking it should be possible with the
    use of win32ole.

    I am able to reach the movie object with win32ole, but I don't know how
    to be able to call the methods created in the Flex application.

    I am not that familiar with the win32ole, but can it work as a activex
    control, or do I need something else?

    Thank you for any advice!

    --
    Posted via http://www.ruby-forum.com/.
    Peter Motzfeldt, Feb 28, 2007
    #1
    1. Advertising

  2. Peter Motzfeldt

    Guest

    It's very simple really, you just instantiate a Ruby object to the
    WIN32OLE interface of the native API, then call the native API's
    methods as methods of the object you've just created. Example:

    require 'win32ole'

    param1 = 0
    param2 = 'test'

    interface = WIN32OLE.new('registered_OLE_API_here')
    interface.NativeMethodReqIntAndString(param1, param2)

    nativeObj = interface.ReturnSomeObject
    nativeObj.ObjectNativeMethod

    interface.NativeMethodReqNativeObj(nativeObj)

    This is a trivial example, but shows how you can instantiate and use
    native objects using the win32ole interface, and how you can pass them
    back to the native API as method parameters.

    Hope this helps,
    --Kris



    On Feb 28, 6:48 am, Peter Motzfeldt <> wrote:
    > Hi
    >
    > I am working on a master thesis at Norwegian University of Science and
    > Technology, and I am trying to create a open source framework for
    > functional testing of Flex applications. And I want to do it in Ruby.
    >
    > I am playing with the ExternalInterface API for Flash applications. With
    > this API it is possible to define methods, which will be visible through
    > activex.
    >
    > This is shown in the example in the link belowhttp://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/ww...
    >
    > This example uses C#, but I was thinking it should be possible with the
    > use of win32ole.
    >
    > I am able to reach the movie object with win32ole, but I don't know how
    > to be able to call the methods created in the Flex application.
    >
    > I am not that familiar with the win32ole, but can it work as a activex
    > control, or do I need something else?
    >
    > Thank you for any advice!
    >
    > --
    > Posted viahttp://www.ruby-forum.com/.
    , Mar 1, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bernie
    Replies:
    0
    Views:
    522
    Bernie
    Sep 5, 2004
  2. Masaki Suketa
    Replies:
    4
    Views:
    364
    Dave Burt
    Mar 27, 2006
  3. Peter Nicolai Motzfeldt

    Win32Ole, ExternalInterface (Flex), return objects

    Peter Nicolai Motzfeldt, Mar 21, 2007, in forum: Ruby
    Replies:
    0
    Views:
    81
    Peter Nicolai Motzfeldt
    Mar 21, 2007
  4. zxem
    Replies:
    1
    Views:
    214
  5. Andrew Thelwell
    Replies:
    0
    Views:
    107
    Andrew Thelwell
    May 17, 2007
Loading...

Share This Page