Embedding Flash Player in Windows Applications using C#

The Macromedia DevNet center has just published an article I wrote that discusses embedding the Flash player within Windows applications using C#.

The article is based on the Stock Charting Windows application which is included on DRK 4. The application uses the line chart component from the Flash Charting Component Set 2 to chart historical stock data within the windows app.

You can read the entire article here.

26 Responses to Embedding Flash Player in Windows Applications using C#

  1. Mike,Great article! What an excellent resource and tutorial for folks interested in embedding the Flash player within a windows app. I have had a lot of success embedding the player within Visual Basic apps. Now I am excited to start working with .NET as well.Keep up the great work! And congrats on getting DRK4 out the door, looks like quite a collection!Rob

  2. Ahmet Zorlu says:

    Thank you for the article,Just a theoretical question. Instead of passing data to the player as String, would it be ideal to pass data as an AMF package (e.g. using classes in System.Runtime.Serialization namespace). For example a DataSet can be passed to the interpreter and it can be deserialized as native ActionScript datatypes. Would this be possible without making use of the proxy used in Remoting for .NET?

  3. Jon Bradley says:

    Hey Mike,Great article! Now … all we need is someone to show us how to embed Flash into an OS X application using Objective C and Project Builder (or X Code when it comes out for Panther).cheers,Jon

  4. mike chambers says:

    >Instead of passing data to the player as String, would it be ideal to pass data as an AMF packageThat is a good question. The only way that I think this would be possible is the have the windows app and flash movie talk to each other via Flash Remoting.Even then, yo uwuold have to figure out how to use the Flash Remoting server side DLL in your code. (which is not document).It is also a potential secruity issue as your app essentially becomes a web server.However, that does not mean it is not possible in a better way, but I just dont know.hope that helps…mike chambersmesh@macromedia.com

  5. Paul says:

    Thanks for the article. Good stuff!How about passing data from Flash to C#? FSCommand? …or are there cleaner ways of doing it?

  6. mike chambers says:

    Yes. You would use FSCommand, which would then trigger an event in C#.It is not that difficult, and perhaps if i have time, I will write another article on it, or post some info on my weblog.mike chambersmesh@macromedia.com

  7. Mark says:

    Hi mike,it is possible to Listen when the FlashPlayer Crash over the 200.000 actions ?Of I have 2000 line of code in C# ,I don’t would the ALL of my code was compromised by the Stupid Crash of FlashPlayer over the 200.000 actions …Mark

  8. prabhutech says:

    Mike,It’s good to hear that we can embedd Flashpaper into windows application.But, it’s bad we can’t embedd Flashpaper just into another Flash application.Is making Flashpaper as a popup from a Flash file a only way to work with another Flash application? Did we thought about it? 🙁

  9. ian grainger says:

    hi, great article! i was just wondering if anyone has any ideas about applying any of this to an ASP.NET web form as opposed to a windows form – specifically if there is some way to use ActiveXObject.SetVariable in C# as this would solve the problems i’m currently having! (javascript’s .setVariable command DOES NOT WORK in an ASPX page).

  10. Don says:

    Hi Mike,Great article. It was all a little forign since I’m not familiar with C#, but informative nevertheless. I actually found this by searching the net for a solution to add the ActiveX Shockwave Flash Object into a C++ MFC app. Unfortunately, there’s no documentation on such an animal, but I’m going to tackle this and figure it out anyway, so I’ll write an article in the process. I’ve been thinking of a good subject to write about anyway. :)I’m developing an RSS News Aggregator and after a lot of investigation, it appears that Flash is the best solution for the News Ticker, as it has a nice smooth scrolling appearance and requires minimal system resources.The movie and all of the RSS/XML stuff’s done and it plays fine on my dialog, but I have one little problem. I’m hoping you or someone else reading this can help. I need the background to be transparent but if I simply change the WMode to “Transparent”, the entire movie dissapears. Of course, it wouldn’t be that easy. Any ideas? Or do you know where I can find some half-way decent documentation on the properties of the control?Again, thanks for the info!Don

  11. Martha says:

    Congratulations to your fantastic Site. Thanks

  12. NStarer says:

    Thanks for the pointer! i was about to start asking questions about that.

  13. FlorinDumitrescu says:

    Hi Mike,I have to make a C# application which can play .swf files. The problem is I need an event to tell me when the playing of the movie is complete which the Shockwave Flash Object doesn’t seem to provide. Am I missing something?Any help in this matter will be very apreciated.BTW: Great article.

  14. Chuck Stein says:

    Mike,How can I embed a Flash Player into a C++ application?Thanks,Chuck

  15. Yomi Sunmonu says:

    I re-echo an earlier question, and hope you can supply me with the answer. How would you add a flash player (to play swf files) in a web app made with C# ?Thank you.

  16. mike chambers says:

    >I re-echo an earlier question, and hope you can supply me with the answer. How would you add a flash player (to play swf files) in a web app made with C# ?http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_4150mike chambersmesh@macromedia.com

  17. Aashi says:

    Hi,I have used this setvariable function in Flash MX 2004 Pro. but it is giving problem in Flash MX :)what should I do? Is there any way to use this function which will work in Flash MX also…Thanx

  18. Aashi says:

    Hi Mike,I have used this setvariable function in Flash MX 2004 Pro. but it is giving problem in Flash MX :)what should I do? Is there any way to use this function which will work in Flash MX also…Thanx

  19. robbie says:

    Does anybody have any info on the best way to detect if the user has Flash installed or not, before the flash object is loaded into the form?I’m guessing there must be some info out there on where on each OS the player is installed to, and the form could do a check to see if the file exists or not? Or is there an easier way…?

  20. Lokesh Sharma says:

    Great atrical, I am very much happy to use the C# with Flash. This a great exitement to me to use the C#……………..

  21. Lokesh Sharma says:

    Great atrical, I am very much happy to use the C# with Flash. This a great exitement to me to use the C#……………..

  22. Vinu says:

    Hi Mke,Great work!!!, I am also intreated in using C# and Flash. Please help me, how to read the srteam details of a user from Communication app inspector – Flash communication server?is it possible?regards,Vinu

  23. Dennis says:

    I have the same question as Aashi.What is the best way to detect if the user has Flash installed or not, before the flash object is loaded into the form?anybody can help?thx.

  24. Phill says:

    Mike, thank you for your informative and well written article. I am developing a c# app that utilizes flash and it needs to be strongly named to support updating code that I have written (and because it is good practice). The AxShockwaveFlashInteropObjects or whatever dlls are not strongly named when generated at compile time, which throws a whole bunch of problems into my application. How would I resolve this?

  25. nirav says:

    connected to flash with window application

  26. dinhcuong says:

    i have Embedding Flash into C# is finish, but all control on Flash is not use. why ?