Php – Loading multiple embedded flash apps onto an HTML page- problem with ordering

flashPHP

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.

Best Answer

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.

Related Topic