tags:

views:

163

answers:

2

We need to load an embedded version of a site written in Flash, and not originally designed to load multiple instances of itself, on a HTML page. The specific issue is how to get them to load in order when embedded, given that they are all being opened by the same instance of the flash player.

It's a complicated mapping application, and at the moment, the maps and data get intermixed as the session variables are overwritten by another instance starting to load before the previous one has finished. We need a way to have them load sequentially, one finishing before another starts to load.

The most we can specify in the URL is an &order=1 or similar. We have PHP and SQL on the backend.

Edit: The embedded versions are being loaded in an iFrame of a parent site. One php file loads one swf, as many times as the parent site desires.

A: 

I would use Javascript and swfobject to load the Flash apps sequentially onto the page. The javascript code would contain the order it wants to load the flash apps in and each Flash app should notify the javascript on the containing page when it has completed loading by calling a function in the javascript via ExternalInterface, which would then trigger the loading of the next Flash app in the list.

hasseg
Yes, we have tried the ExternalInterface. Unfortunately the flash file we are trying to the the information to is an AS2 file, being loaded by an AS3 file, so there is no way to directly target it. GSkinner's magic isn't an option as we are trying to pass the flash communicator ID to both files!
shudson250
A: 

I feel sorry to tell my solution mustn't seem the most simple but may be the most realistic to keep a stable version up, alas. Probably you may spend a couple of days re-factoring the setup core of the application so it matches the current requirements.

It's often not a good thing to find out an external 'hack' to make it kind-of-work as it may get wasted and complicate things even more further on. By experience, all summed up you always spend more time (and painful one) by tweaking such kind of 'quick-fixes' than you would have done sitting down thinking it over for a while.

Theo.T
We've certainly had that experience.We're trying to push out the next version before we make the big leap to flex/as3. This jump will solve the problem completely, but other matters are more pressing.
shudson250