From the main application I load a sub-application with SWFLoader, in a sibling applicationDomain.
loaderCtx:LoaderContext = new LoaderContext();
loaderCtx.applicationDomain = new ApplicationDomain();
swfLoader.loaderContext = loaderCtx;
From my main application, how can I get a reference on the subAp instance ? (to change the value of an attribute for example)
Note : When they are in the same applicationDomain, I can use SystemManager(swfLoader.content).application but here the conversion to SystemManager will throw an error.
Adding to your question...
There is an example in Adobe tutorial sub-application.
After some head scratching, I realized both applications need to be in the same project to build and then it worked !
Parent application is able to resolve type SubApp2 (reference to subApplication) via dynamic typing.
Is this the only way ? Can I define my Sub application type manually somehow ?
Also, I can get the reference if the subapplication is loaded immediately after the parent hits oncreationcomplete.
However, I can't get the reference if subapplication is loaded at a later time dynamically... say by the event of a button.
What is the reason ?