views:

228

answers:

2

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?)

A: 

You talk about targetting the embedded flash file directly and yet you ask for setting an javascript variable. That's a bit confusing.

So, you're setting an js variable on the page from as2, right?

Check out this blogpost, as it has some good points

Here's another way to talk to js if you do not like ExternalInterface.

Mikko Tapionlinna
ExternalInterface was the solution we were trying, but because we're trying to get the variable directly to as2, we cannot target the movie (without targeting the AS3 loader).
shudson250
A: 

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.

we are using swfbridge but ran into problems with multiple instances. If you ever use it, know that you must have unique ID's assigned to each instance playing in different browser windows. We solved that problem with php session variables, but they can be overwritten. thus we are here.
shudson250