R – Send data to a Flex 3 application from an SWF (version 7)

actionscript-3apache-flexflashnet

Does anyone know how to take a swf (version 7) and use the SwfLoader or something similar to access a root variable in the swf from a Flex application? I have tried many things with no success. I don't want to clutter this post with all of my failed attempts, but I will post them later if I see that they are needed as examples.

Just some background: I am generating the swf file in .NET and the library I am using can only generate swfs up to version 7. The Flex app is being built with Flex 3. I need to access variables in the swf. I don't care how it is done, As long as I can do it. Doesn't matter if I am bubbling an event or using the LocalConnection or directly accessing the variables, I have had no luck doing any of that up till this point. (The swf does load though… and shows up in my Flex app).

Oh, and the swf is not embeded.

Best Answer

ExternalInterface has been availble since as1.0, so that may be the solution to your problems. With the ExternalInterface class actionscript can communicate with javascript, and vice versa. So, you could pass a variable to a javascript function from the swf and have that javascript function pass that same variable to a function in the FLEX app. I dont want to write all the code unless this sounds like it may be the answer you are looking for, in which case let me know and I will write out the code for you, or just ...

Check it out: ExternalInterface

Related Topic