I am loading a content SWF into a container and I want the content SWF to exist in a child application domain to the container. Therefore, the structure should look like:
[system] -> [container] -> [content1]
[system] -> [container] -> [content2]
…
In my container SWF I load the content SWF with:
_newDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
var ldrContext:LoaderContext = new LoaderContext(false, _newDomain);
_swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoad);
_swfLoader.load(swfRequest, ldrContext);
Then in my content SWF I added the following code to verify that the application domains were being setup correctly:
var parentDomain:ApplicationDomain = ApplicationDomain.currentDomain.parentDomain;
if (parentDomain == null)
{
trace("Content is running on its own, no parent domain");
return;
}
That if-statement is being triggered, meaning the content does not recognize the existence of a parent application domain.
Where am I going wrong here?