I have a lightweight loader application that is trying to load the main application (the target). The loader needs to detect when the main application has finished loading so it can call a method.
Where I'm running into trouble is that if the target is on a different domain, I get a 2121 error when I try to add an event listener to the loaded app: "SecurityError: Error #2121: Security sandbox violation: This may be worked around by calling Security.allowDomain".
I am calling Security.allowDomain("*") in the target during the preinitialize phase.
Here is the code that generates the exception, called when the SWFLoader dispatches the COMPLETE event:
var content:SystemManager = SystemManager(client.content);
content.addEventListener(FlexEvent.APPLICATION_COMPLETE, appReady);
In this "client" is an SWFLoader object in the loader.
What event can I listen for on a crossdomain SWFLoader object that will tell me it's application is ready for use?