1 Reply Latest reply on Dec 31, 2010 2:35 AM by Chris_ch_Cheung

    ApplicationDomain.currentDomain.parentDomain is null

    Chris_ch_Cheung

      Problem in short:

      somewhere in my code, I used ApplicationDomain.currentDomain.parentDomain.

      and on FlashPlayer 10,0,45,2 (debug) it is not null (good behavior), but on FlashPlayer 10,1,102,64 (non-debug) it is null.

      Does anyone knows what is the cause and any workaround for this~?

       

      Thanks~
      Chris

       

      more details:

      to my understanding, my application domain is structured like this:

      systemDomain

      commonClassesDomain

      application1Domain

      application2Domain

       

      and the loading sequence is like this:

      1. commonClasses.swf is loaded
      2. it use Loader.load to load application1.swf with loaderContext = new LoaderContext(false, new ApplicationDomain(ApplicationDomain.currentDomain));
      3. at some point, application1 use SWFLoader to load application2.swf, with
        appDomain = new ApplicationDomain(ApplicationDomain.currentDomain.parentDomain), and
        loaderContext = new LoaderContext(false, appDomain)

       

      the problem is that if ApplicationDomain.currentDomain.parentDomain returns null, application2 can't share the classes loaded in commonClassesDomain.

      the problem only occurs on some version of flash players... I tried to read through the flash player release notes, but nothing seems relavent...

      Please Help~

       

      Thanks~

      Chris