tags:

views:

329

answers:

3

I want to display a simple .SWF file on my WPF Form. It's a simple animation on loop.

Is there a control "box" type element I can place on my form and just load the .swf file to it so it can play?

Thank you for the help. :D

+3  A: 

You basically have to host it inside an html page and then reference the swf through the html page. On the WPF side you'll put a Frame xaml tag in your app that will refer to the html page.

Here's a link about how to do it.

Joseph
So my application will have to deploy with 60+ HTLM pages if I have 60+ .swf files? Is there not a better way? Thanks for the help. :D
Sergio Tapia
@Papuccino1 I'm not aware of one at this time. Maybe at some point someone will make a FlashPlayer control for WPF, but I don't know of one that exists. I highly doubt it though, since swf is proprietary to Adobe.
Joseph
+1. The easiest way. @Papuccino1, you don't have to deploy all the stuff. You can host it somewhere on your server. Furthermore, you can have one HTML page, and some basic JS API, to switch flash objects. WebBrowser control allows you to interact with JS...
Anvaka
A: 

Well - can you convert this animation into XAML? That would be the best.

WPF and Flash are not really compatible to each other :-)

It could work using the WebBrowser class - there's no elegant way I know, however.

winSharp93
No, I cannot convert it. It's literally an animation for a character, sort of like it's preview of it in the live game.
Sergio Tapia
A: 

A solution for a similar question can be found here: http://stackoverflow.com/questions/1439056/how-to-play-flash-in-wpf-application

In summary, you can use AXShockwaveFlash. Instructions found: http://www.pooredesign.com/blog/?p=d9165e80-d075-4faf-8a10-bfaf17769198

Also: although the description uses YouTube as an example this should work with local files as well.

Alex