I currently maintain an application that's written in Flash 8 (AS2) which is used to embed and control some auto-generated SWFs. The auto-generated SWFs are also Flash 8 (actually, they work at least in 7, possibly even older), so my current app is able to directly reference variables and functions within the embedded SWF.
We're now working on a new version of this application, written in Flex. We need to duplicate the current app's functionality of embedding and controlling the auto-generated AS2 SWFs. However, AS3-based SWFs can't reference variables or functions within an embedded AS2-based SWF. Unfortunately we don't have control over the auto-generation tool, so we can't change that to output AS3-based SWFs.
The only real solution to getting the AS3 and AS2 SWFs to communicate is to use LocalConnection. I'd need to create a wrapper AS2 SWF that would load the auto-generated SWF and act as a proxy, communicating with my Flex app via LocalConnection and doing whatever needs to be done to the auto-generated SWF. However, there's a problem with this. The proxy SWF needs to know what LocalConnection ID to use, but I can't find a way to communicate the ID to it (I can't just hard-code some random ID as I need to be able to support multiple instances of this app simultaneously).
Has anyone solved this? Is there any way to get some kind of unique identifier to the embedded SWF?