![]() |
|||||||
Hybrid Hacking provides tutorials on how to integrate with some of today's hottest web services.
|
Loading ActionScript 2 Content in Flex
Tue, 06/19/2007 - 04:53
Flex 2 has difficulties loading SWFs that aren't published as ActionScript 3. If you want to load Flash movies that are published as ActionScript 2 into your Flex project you can use an SWFLoader. However, if you want to call ActionScript commands on that loaded file you need to communicate using a LocalConnection. Peter Ent has a thorough explanation of this process here. I had a hard time setting up this LocalConnection while I was building an application to load my old Flash content. So in order to make it easier for others I have created a custom Flex Component called "ProxySWFLoader" that abstracts this LocalConnection code and can easily be dropped into your Flex application instead of using an SWFLoader. This component will have no problems loading ActionScript 2 files, as well as ActionScript 3, JPG, GIF, and PNG files. It acts just like an SWFLoader, except it now allows you to call functions on the target file. Example Instructions:
Once you have an idea of how it works based on this example, you can drop the ProxySWFLoader component into your own Flex projects as long as the proxySWF.swf file is also in the same directory. Note that this code currently only supports having one instance of the ProxySWFLoader component in your project. Hopefully this will make your life a little easier. If you experience any problems with this example please leave a comment below. Comments
Fri, 08/24/2007 - 08:40 — luda (not verified)
Dear Shongrunden, I tried your code in Flex builder 3.
Thu, 08/30/2007 - 17:39 — shongrunden
Hi Luda, I just tried it in Flex Builder 3 and it's not working for me as well. It looks like Flex Builder 3 changes the default security settings. I haven't been able to fix this yet, but will post an update if I can get it going. Steve
Tue, 05/06/2008 - 10:00 — Patrick (not verified)
Hello. I'm from Italy, so sorry for my english; Patrick Post new comment |
||||||