2 Replies Latest reply on Nov 26, 2010 11:05 PM by Addict198000

    Class is null in my module





      I have an application that loads some modules at runtime.

      The modules are defined in an xml and loaded via ModuleManager.

      Those modules contain dynamic parts of the application.
      (eg: every module contains a list of class discriptions, and a class reference)

      Those class descriptions are shown in a tree, when hitting an item a new class instance is created.



      The issue I'm having is the following.
      The module has 4 swc references.  2 of them are set to "merged into code".

      When I change those to "external" (because they are already used in the main app), everything compiles fine, but when loading the data, my class is NULL and I can't create an instance:


      The source of the function on my interface:

      public function getAnalyses(): ArrayCollection


           var analyses:ArrayCollection = new ArrayCollection();



           var waterfall:AnalysisObject = new AnalysisObject();

           waterfall.AnalysisID = "Waterfall";

           waterfall.path = LocalizationUtil.localiseKey("ANALYSIS_ASSESS_TREE") + SEPARATOR;

           waterfall.weight = 555;

           waterfall.analysis = WaterfallAnalysis;

           waterfall.tabLabel = LocalizationUtil.localiseKey("ANALYSIS_COMPANYWATERFALL_TAB");



           return analyses;



      -> waterfall.analysis contains the value NULL when returned...

      -> waterfall.analysis is of type "class"


      I've got the following compilation arguments: -load-externs=c:\temp\report.xml



      Can anyone tell me what I'm doing wrong?

        • 1. Re: Class is null in my module
          Flex harUI Adobe Employee

          Is WaterfallAnalysis a class?  It is rare to be referencing a class in a



          Check link-reports to see who is now responsible for bringing in that class

          or interface.

          1 person found this helpful
          • 2. Re: Class is null in my module
            Addict198000 Level 1



            WaterfallAnalysis is a class.  I store it as a reference.
            When the user decides to open one or more waterfall analysses, I create them via that reference.


            I searched a bit longer and used a decompiler to see what's get compiled into the module when choosing for "Merged Into Code".

            Because I'm using the "load externs" option, I didn't expect to see much.  (my main app references all the libraries).


            In the decompiler, I saw that a couple of classes were still embedded. 

            A quick search learned me that they were not used in the main app.

            They were created in the module and used on an interface or on an object that is OO-wize above.


            I created manifest files and linked the libraries as "RSL" into the main app.

            That made the library files include all the files.
            When recompiling my modules again, everything worked fine.