dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: communication between flash & C++?

  1. #1
    Junior Member
    Join Date
    Sep 2007
    Posts
    10

    communication between flash & C++?

    Hello All,

    I am using MAC OS X (10.4.X) to develop my application.

    I want to communicate between flash & C++(which is container app for .swf), the data(in string format) transfer should be vice-versa i.e. from C++ to flash & from flash to C++. How can I do this? Any APIs to complete this functionality such as ExternalInterface/XMLSocket/SharedObject etc.? Which will be the best? OR Is it possible to communicate directly with the flash of the web-site from C++?

    Any help is greatly appreciated.

    Thanks in advance!

  2. #2
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    We did this with ExternalInterface when talking to C#, so you should be able to to do it with C++.
    Basically, ExternalInterface expects blocks of xml in a certain structure that has the handler name and any arguments you're passing to it. I think Flash then converts it and calls the handler for you with those arguments. In the other direction, I believe Flash serializes the command, and you have to deserialize it on the C++ side, but i wasn't writing that bit so I can't quite remember (this was about two years ago).

    Try this: http://www.ifbin.com/news/2005/08/fl...e-example.html
    Sam



  3. #3
    Junior Member
    Join Date
    Sep 2007
    Posts
    10
    thanks for reply,
    we can use shockwaveflash.dll to accomplish this on windows but I want to do it on MAC OS 10.4 which doesn't support dll. Do you have any demo/tutorial to get the idea about it. I searched all the internet for this stuff but no luck! I am thinking of using ExternalInterface but not getting how to use it exactly.
    please help!

  4. #4
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    Unfortunately, I don't think there is a way to embed a flash player instance directly into Objective-C like there is in C#.
    Windows relies on using the ActiveX control embedded into a C# container, but there is no equivalent to ActiveX on Mac OS X.

    Then next best thing would be to embed and instance of WebKit, and then have that display the Flash. I'm not sure, however, if you can then communicate with the rest of a Cocoa application from the Flash embedded in webkit. Maybe through ExternalInterface going through WebKit, and possibly there is something in the API that lets you inspect properties within the WebKit instance.

    I'm not sure, but it's not as simple (and that's not saying that it was easy on Windows).

    Presumably it is possible, as companies like multidmedia have pulled it off with Zinc. But they are also licensing the Flash player from Adobe so have and are basically building their own entire 'shell' around a flash player instance.
    Sam



  5. #5
    Junior Member
    Join Date
    Sep 2007
    Posts
    10
    Basically I want to communicate with the website which has flash UI with drag & drop functionality. These drag & drop events I want to catch in my C++ code & make respective changes. This can be implemented by embeding flash in C++ & this flash will communicate with website's flash using local Connection API easily. Is it possible to call C++ function from javascript? As you are suggesting to use instance of WebKit, how to use it with my problem? I am newbie to it & I don't know how to deal with it.
    Thanks in advance.

  6. #6
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    To be honest, I don't know either. I've never actually built something like what you're describing. Those were just suggestions of where to start looking, I can't really help you actually build it.

    The alternative might be to use something like Zinc, maybe it supports drag and drop?
    Sam



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center