Mike Chambers

code = joy

Embedding Flash Player in Windows Applications using C#

with 31 comments

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.

Written by mikechambers

July 29th, 2003 at 10:22 pm

Posted in DRK

31 Responses to 'Embedding Flash Player in Windows Applications using C#'

Subscribe to comments with RSS

  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

    Robert M. Hall

    29 Jul 03 at 11:08 pm

  2. 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?

    Ahmet Zorlu

    30 Jul 03 at 4:36 am

  3. 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

    Jon Bradley

    30 Jul 03 at 10:12 am

  4. >Instead of passing data to the player as String, would it be ideal to pass data as an AMF package

    That 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 chambers

    mesh@macromedia.com

    mike chambers

    30 Jul 03 at 11:09 am

  5. Thanks for the article. Good stuff!

    How about passing data from Flash to C#? FSCommand? …or are there cleaner ways of doing it?

    Paul

    30 Jul 03 at 12:06 pm

  6. 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 chambers

    mesh@macromedia.com

    mike chambers

    30 Jul 03 at 12:16 pm

  7. 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

    Mark

    31 Jul 03 at 5:08 am

  8. 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? :(

    prabhutech

    11 Aug 03 at 12:30 pm

  9. 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).

    ian grainger

    13 Oct 03 at 10:55 am

  10. 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

    Don

    15 Nov 03 at 5:44 pm

  11. Congratulations to your fantastic Site. Thanks

    Martha

    22 Dec 03 at 9:15 am

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

    NStarer

    24 Feb 04 at 1:47 pm

  13. 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.

    FlorinDumitrescu

    25 Aug 04 at 5:31 am

  14. Mike,
    How can I embed a Flash Player into a C++ application?

    Thanks,
    Chuck

    Chuck Stein

    1 Oct 04 at 3:15 pm

  15. 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.

    Yomi Sunmonu

    17 Feb 05 at 12:32 pm

  16. >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_4150

    mike chambers

    mesh@macromedia.com

    mike chambers

    22 Feb 05 at 5:35 pm

  17. 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

    Aashi

    14 Mar 05 at 2:13 am

  18. 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

    Aashi

    14 Mar 05 at 2:13 am

  19. 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…?

    robbie

    23 Mar 05 at 1:21 am

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

    Lokesh Sharma

    28 Mar 05 at 12:41 am

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

    Lokesh Sharma

    28 Mar 05 at 12:46 am

  22. 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

    Vinu

    6 May 05 at 7:43 am

  23. 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.

    Dennis

    25 May 05 at 1:45 am

  24. 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?

    Phill

    22 Aug 05 at 10:52 am

  25. connected to flash with window application

    nirav

    25 Mar 06 at 2:13 am

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

    dinhcuong

    22 Jun 06 at 1:36 am

  27. Hi,
    Mike. I am coming across some problems when i try to embed a Flash Player into a C++ application.
    will you be kind to tell me how I can embed a Flash Player into a C++ application. and when the Flash player is running on the C++ application I wanna get the state of the player, for example, when will it end and how to close it and how to open.
    Thanks very much.
    Anyone else who have better solution can contack me.
    thanks again

    Sally

    13 Aug 07 at 6:23 pm

  28. Hi…
    I have used object tag in the same way. I am playing flash file bt now i want dat wen flash file finishes playing, so a button shld be enabled. How can i do this. Plz help me. I have searched a lot on this. Bt i just don’t understand how to do it in c#….

    Needhi

    4 Sep 08 at 10:32 pm

  29. Great Article.

    In onr application, when using the flash control in a C# form, sometimes the SWF associated with the control won’t load on some computers. On inspection, it was found that those computers had an older version of flash player than the one included in our application.

    Question: How does one detect the already installed version of Flash Player in C# desktop apps so that it does not end up breaking the whole applicaiton?

    There are many methods to do this in web pages.

    Any inputs would be great.

    Thanks

    RC

    4 Jul 09 at 1:19 am

  30. Hi
    I want a know how can i load flash in c# or c# wpf
    thank

    Ho

    7 Jan 10 at 7:10 am

  31. Mike,

    The links in your post above are broken, as it appears that Adobe is no longer showing your articles on embedding the flash player inside an application. Is there an updated location for this information, or, could you post the original articles on your site?

    Cheers!

    Michael Curry

    10 Oct 10 at 7:20 pm

Leave a Reply

Follow

Get every new post on this blog delivered to your Inbox.

Join other followers: