Should work if the swfs are all in the same domain on the server.  How
are you accessing the static classes?

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of residentevil_64
Sent: Thursday, May 03, 2007 8:18 AM
To: [email protected]
Subject: [flexcoders] Using Application Domain



Hi all, 

I am currently creating a Flex application that has a shell
application and it will load in several other SWF files at runtime. I
want the SWF files to access the static classes in the main shell
application. I use a loader (flash.display.loader) with the
loadercontext to the current application domain as below. 

var loader:Loader = new Loader();
var context:LoaderContext = new LoaderContext();
context.applicationDomain = ApplicationDomain.currentDomain;
loader.load(new URLRequest(source),context);

However, when I try to access the main application static classes, I
got a null reference exception. I read from livedocs that by setting
the ApplicationDomain, I will be able to access the singleton
classes/static functions of the main shell application. Am I missing
somenthing?

Also, I tried to modify my application by having my SWFs inheriting
from ModuleBase and using ModuleManager to load them. However, I am
getting the error that they did not inherit from Sprite and thus
cannot link to the root of movie. I am using pure AS classes to do
this. Anyone has any example on using ModuleManager loading SWF
compiled from AS class extending ModuleBase

Any help / example / feedback will be appreciated. 

Thanks!

;)



 

Reply via email to