views:

230

answers:

2

Using .NET (Windows), you can embed an ActiveX Flash player into a Windows form, load a swf file and set variables or invoke functions with single method calls from C# (I imagine because of the presence of a Flash OCX).

That said, I would like to do the same thing in MONO (Linux): how could this be possible?

A: 

Is it possible to "embed" an HTML page, using some (system controlled) prefered renderer (like firefox)? In that case it might be possible to get a flash in there and control it through javascript... It does sound a bit far-fetched though.

If you do manage to get the flash in there, you might be able to communicate with it through a TCP/IP connection from the flash to your program.

Jonatan Hedborg
No, no HTML page is possible!
It seems like this questions has been asked before;http://stackoverflow.com/questions/643872/how-to-embed-flash-in-monoHave a peek there.
Jonatan Hedborg
Oh, sorry, I retire my question as soon as possible.
Finally, we decided to use the good old HTML page: it perfectly works (see my comment below).
A: 

Flash takes the form of an ActiveX (i.e. COM) DLL on Windows because that's the preferred extensbility platform for Internet Explorer. In other browsers, and on other platforms, Flash takes a different form, using the browser plugin API I believe. Since ActiveX is a no-go on Linux, perhaps it might be possible to implement a plugin host of some sort that can make the Flash plugin think it's running inside a browser. This would probably be "non-trivial" as they say, but theoretically possible.

Michael McCloskey
Hi Micheal, I found you can use a WebBrowser component and call JavaScript methods from C# using InvokeScript. So I can call ActionScript methods using a gateway function written in JavaScript: C# calls JavaScript, JavaScript calls ActionScript (this last one eventually returns anything to JavaScript and then to C#). I still haven't tried to embed a swf file in the WebBrowser (without HTML) and directly call an ActionScript method (I'm sure it doesn't work but...)