tags:

views:

4592

answers:

6

I would like to embed Flash Player directly inside a C++ or Java application.

I found an article that describes how to do this for C#: http://www.adobe.com/devnet/flash/articles/stock_history03.html

Unfortunately, I have no experience with C#, COM or ActiveX. I need someone to translate this code to C++, allowing me to embed the Flash Player into a Win32 Window. Ultimately I'd like to use this information to embed Flash into a Java application.

I am looking for three main functionalities:

  1. Ability to play a Flash movie
  2. Ability to receive events (such as mouse clicks)
  3. Ability to send events

Edit: I prefer an open-source solution if possible.

+3  A: 

I don't know how to embed flash in C++, but Christopher Deckers (of SWTSwing fame) has developed an interesting hack which allows it to be embedded in Java. You can find more information in the Javalobby announcement thread.

Daniel Spiewak
Great, now that the question has been edited to only refer to C++, my answer sounds stupid and OT. :-)
Daniel Spiewak
Sorry ;) I was hoping to make the question easier to answer...Great links. Unfortunately Christopher uses SWT to achieve this. It doesn't look like his NativeSwing is interoperable with normal Swing components (which I was hoping to use).
Gili
Actually, it *is* interoperable, that's the whole reason he did it. :-) You can of course always use SWT by itself, but if you want to embed native stuff like a browser, Windows Media Player or a flash player within Swing, DJ Swing is the way to go.
Daniel Spiewak
Wow, you're right! That's pretty huge... I'm surprised this hasn't made big news in the Java community. At least I didn't hear about it :) Thanks a lot for this link. You've literally saved me weeks of work.
Gili
A: 

If you want to go with a commercial solution, I'd recommend Scaleform GFx. It's not cheap, though, but it's damn good.

Adam Rosenfield
A: 

One simple way to create a Flash player in your window: AtlAxCreateControlEx.

To receive and send events, you will need a sink: AtlAdvise. You will need to define the functions receiving events on the ActionScript (i.e. Flash) side too.

Heng-Cheong Leong
How can you do this? Can you provide some code sniplets to demonstrate this?
Gili
A: 

I personally haven't tried this but say in case of SWT/Java you could embed SWT browser window in you SWT/Java application and in the browser view you could put content with flash content, then communicate say with Merapi bridge with flash movie and java.

+1  A: 

If it has to be open source I'd consider Gnash, an open source flash implementation.
It works on all major platforms, supports most multimedia codecs and is supposed to be embeddable in applications through nsapi.

tstenner