Communicating between Flash CS3 and Flex 3 applications
Posted by vipin on April 15, 2008
We had a strange situation at work of loading a Flash CS3 application inside Flex 3 application. As everything is AS3, I thought everything will work smoothly. But at the time of integration we have to finally understand the fact that the Flash CS 3 application cannot be loaded into Flex application, and it is giving an error which says ‘Cannot change the name property’ or something like that.
We tried various things and finally after few hours of Google’ing it was obviuos that a Local Connection will only do something. We made one more Flash CS3 app which will load the Flash CS3 and Flex 3 application into it and using Local Connection, both the application will communicate. At the same time we found an amazing library by Grant Skinner, which is called SWFBridge, which can be used to have different swf applications talk to each other (as3-as3, as3-as2, flex-flash etc). Here is the link to the source of the library, and it is free to use if you are not modifying the source. You just need to declare the instance of the class as instance property and say connect(). The communication works without any issue, and make sure you call the close() method when the communication is no more required, or else if the application is not properly shut down, it may cause issue.
I dont know this is the best method for fixing our issue, but it was a good workaround at the last moment, and thought I will share with others who have the same issue.
Jean-Christophe TURIN said
Thanks a lot for this tips! I’ve just started looking at the ways of communicating between flex & flash, and I’ve been directly redirected to your post with your experience and the workaround. Cool! =) Moreover, I’m a great fan of gskinner, but I hadn’t seen this class. Thx again vipin! CheerzZ & Happy AS!