Flex and C# Communication (Tutorial)

While waiting for Apollo i decided to check out what can be done with flash on the desktop today.
I`ve never been into microsoft programming but found out that it`s extremely easy to write your own wrapper for swf files in c#.
This gives you the opportunity to write your own Zinc like projector tool. As a start i implemented simple file I/O and a way to start and play cds.
The coolest thing i was able to do was to include microsofts speech recognition and make my flex application react to speech.
The app is quite simple but cool! I have a button on stage and if i say “left” it will jump to the left or if i say “green” it`s text becomes green.

I decided to write a small tutorial about how to embed an swf file into a c# project and how the communication works. Well this is my first public
tutorial so be patient. I had several dificulties:

- english is not my native language
- how to describe things and make them understandable
- how to show code in a nice way

Well i think i failed in coping with all of those challenges :-(

Anyway if i find the time i want to extend this article to the point with the speech engine.
If you want to help me i would be very interested in suggestions and corrections.

Check it out here.

Comments

18 Responses to “Flex and C# Communication (Tutorial)”

  1. Reader on December 5th, 2006 2:42 pm

    great tut! very useful!

  2. Alex C on January 2nd, 2007 1:34 am

    Excellent tutorial! Thanks for sharing. I wish more folks would share Flex .NET articles.

  3. Anz on January 16th, 2007 7:23 am

    Really great article!! you rock….

  4. Dan on January 18th, 2007 7:46 pm

    That was excellent!! But i had problems on that, I installed the .dll but it’s still giving me the same error message!!! Please can you help me?? Thanks..

  5. Administrator on January 18th, 2007 8:45 pm

    Hi Dan,

    where exactly have you placed the dll`s?

  6. Dan on January 24th, 2007 6:25 pm

    Hi!! Admin,

    I placed the dll’s in my project directory, as your article said. I think it’s correct, so in the VStudio I can see the shockwave object, but when I try to put it on a winform I have the error message we talk about.

    Thanks for your interest!!!

    Dan.

  7. Anand M on March 22nd, 2007 6:52 am

    Excellent work. But when I created the application the memory started increasing gradually without coming down. I thinks it is a meory leak. Can u help me sort this problem..

  8. Hank on May 23rd, 2007 1:08 pm

    Okay

    I have a good question here, how do I call a C# com plus application from flex?

    Hank

  9. Dll Files Dude on July 28th, 2007 2:08 am

    I have the same question as hank… thats what i was actually googling and found this page…?

    Im sure one else is also going to be googling it in the future…

    So.. anyone have a clue?

    Thanks
    Mike Koenig

  10. hallowreen on August 4th, 2007 1:23 pm

    hey
    C# is difficult,and i just know some actionscript.admire your rich knowledge

  11. David on October 24th, 2007 5:33 pm

    May be long time to comment .But I confirm you article is useful for me.Thanks it make some idea to me.I don’t know about flex more.but I try to know that.
    Thanks

  12. Sam on November 16th, 2007 4:52 am

    Flex and C# Communication, very interested.

  13. Mark in Austin TX on November 26th, 2007 5:54 pm

    Very nice tutorial, explained well. I have been developing Flex and AIR applications and have been longing for a way to call out to C# or COM components for a while.

    Now … if there was just a way to call a C# or COM component from a Flex AIR application, I would really be excited! I am disappointed at the lack of interaction with the local system that Flex AIR allows. General file access is great, but I wish you could launch other processes and call other components. Maybe in a future release.

  14. Elton Bicalho do Carmo on December 19th, 2007 7:58 pm

    Excellent!

    Very useful and easy to understand.

    Keep the good work up.

  15. The Brain on March 18th, 2009 10:33 am

    Here\’s another example of communicating between c# and flash/flex using external interface. example is made in as3 thow, for as2 some modifications should be made

    http://blog.another-d-mention.ro/programming/communicate-betwen-c-and-an-embeded-flash-application/

  16. wolf on July 6th, 2009 7:52 pm

    Hey, the link doesnt seem to work.. can you upload it again please? =)

  17. Jing on July 10th, 2009 7:08 pm

    I clicked the “Check it out here.”. It gives me 404 error. Was the article removed from this site ?

    Thanks

  18. Julien on May 6th, 2010 3:40 pm

    As well for me. Your link is down.

Leave a Reply