Hi,
I am importing an SWF as library at runtime
private function loadDeck(str:String)
{
var ldr:Loader = new Loader();
var request:URLRequest = new URLRequest(str);
var ldrContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);
ldr.load(request, ldrContext);
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, deckLoaded, false, 0, true);
}
function deckLoaded(e:Event):void
{
trace("DECK LOADED");
}
Then I can access all SWF linkages directly, as I added the SWF library to the app-domain.
But…! When I instantiate a new object from the SWF library, the compiler does not know the new Class, and tells me it is not a known object, obviously.
I fixed this problem deselecting “Strict Mode” from the FLA publish settings, but which is the best way to declare the exhistance of a certain class of an external SWF before it is loaded?