Javascript – How to communicate with index from AS2 file, being loaded by an AS3 file

actionscript-2actionscript-3javascript

We are loading an actionscript2 swf into an actionscript3 swf. as3 is embeded on the index page using the satay method.

Is it possible to get a variable set on the index page from within the actionscript2 page, without using the as3 page as an intermediary (as this is not an option)?

We've tried ExternalInterface, but how would we target the embeded flash file directly?

Alternatively, is it possible to send variables to the as2 file, when loading it from the as3 file? (a la get vars? or a flash vars?)

Best Answer

I think what you are looking for is the swfbridge

What you would do is create an as2 wrapper swf that loads the as2 file that you want to use. You can add whatever functions or properties that you want to use in the original as2 file to the wrapper and then, using the bridge, call them from the as3 code.

Takes a bit of doing but the example he provides show how it works.

Related Topic