I have a full browser window AS3 Flash CS4 parent swf which loads a third-party child swf, smaller in height/width and positioned appropriately (i.e. centered). No matter what loading technique I try to use, I'm running into placement and orientation problems in the child swf which break the child.
In one example case, the child will load a secondary displayobject (presumably a movieclip), but attempts to attach it to the stage. If I allow it access to the stage via the SecurityDomain during loading, it orients it at 0,0 of the parent swf instead of 0,0 of the child swf (which is already position/centered appropriately).
In another, the child positioning during load is appropriate, but placement inside the child which seem to reference the stage for their X,Y positions is offset by the amount the child swf has been centered (i.e. if the loader of the child swf is centered such that it's X is at 200, and an object inside the child swf is supposed to be at 100,50, it is actually at 300,50).
The common thread seems to be that the child swfs, whether or not allowed to access the stage, are using stage or player properties of the parent instead of those of their own within the loader.
How can I isolate the child swf such that it only uses it's own sub-environment for positioning and orientation and not the parent's?
I have tried the built-in Loader and UILoader, Greensock's SWFLoader, Flex's SWFLoader and even loading it via text in a TextField.
It seems like AIR's HTMLLoader would work (since SWF objects inside the HTMLLoader apparently use their own stage object), but this app has be available in the browser.
Ideally, I'd still like to be able to communicate with the child, but at this point ensuring the child runs successfully is more important.
This seems like a common approach, yet running into blocking issues left and right make me think I'm approaching this in the wrong way.
My last resort is to replace the parent swf with a JS framework, but only if absolutely essential.
Suggestions for solutions at any part of this process would be appreciated.