What are the options for passing variables from AS2 swf to AS3 swf on AS3 button press?

595 views Asked by At

I have 2 swfs, one image loader which I built a while ago and will eventually update to AS3 and a newer swf I built in AS3. I want to be able to 'pull' a variable from the AS2 swf when a button on the AS3 swf is pressed. How might i be able to do this. LocalConnection wont do it I dont think - i cant load the AS2 swf into the AS3 swf and obviously cant do the reverse though this would be the way to do it if it were possible.

So when a button in the AS3 swf is pressed I want to call the AS2 swf and return a variable from the AS2 swf (the filename of the current image). Would both swfs sharing ExternalInterface work?

any suggestions?

2

There are 2 answers

3
weltraumpirat On

You can use LocalConnection. Or better yet: Use SWFBridge

0
Manish On

As noted above, LocalConnection may not be the most reliable: http://bugs.adobe.com/jira/browse/FP-371

An alternative would be to do a combination of fscommand() and ExternalInterface via JavaScript.