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

23 responses to “Flex and C# Communication (Tutorial)”

  1. Reader Avatar
    Reader

    great tut! very useful!

  2. Alex C Avatar
    Alex C

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

  3. Anz Avatar

    Really great article!! you rock….

  4. Dan Avatar
    Dan

    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 Avatar
    Administrator

    Hi Dan,

    where exactly have you placed the dll`s?

  6. Dan Avatar
    Dan

    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 Avatar
    Anand M

    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 Avatar
    Hank

    Okay

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

    Hank

  9. Dll Files Dude Avatar

    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 Avatar

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

  11. David Avatar

    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 Avatar
    Sam

    Flex and C# Communication, very interested.

  13. Mark in Austin TX Avatar
    Mark in Austin TX

    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 Avatar
    Elton Bicalho do Carmo

    Excellent!

    Very useful and easy to understand.

    Keep the good work up.

  15. The Brain Avatar
    The Brain

    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 Avatar

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

  17. Jing Avatar
    Jing

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

    Thanks

  18. fernando Avatar
    fernando

    where is the link for download tutorial

  19. Thakur Avatar

    Not able to check out the link given above(Check it out here.
    This is the first time i am looking at flex and i am more interested to carry forward on the communication between flex & C#

    Please guide me through.

    Regards,
    Thakur

  20. Thakur Avatar

    Hi,

    This is my first interaction with flex.
    Can i use flex to carry out memory dump of flash application without using ShockwaveFlash COM object?

    Thanks.

  21. Julien Avatar
    Julien

    As well for me. Your link is down.

  22. Inder Avatar
    Inder

    🙁 nothing working….

    link is down..

  23. Thilina Avatar
    Thilina

    The link is not working. I’d be much much greatfull if you can publish again. Or if it’s hard work plz send me a mail.(hkthilina@gmail.com)

Leave a Reply

Your email address will not be published. Required fields are marked *