0 Replies Latest reply on May 13, 2009 6:30 PM by gneeri

    problem compiling module with named package

    gneeri

      Hi,

       

      I'm relatively new to Flex and only recently came upon Flex modules. I am trying to use an interface between the modules and my main application, both to enforce compatibility and to ease data access from the modules to the main application (i.e., the preferred approach on Adobe's module implementation docs). I am, however, running into a problem when trying to compile the module (using Ant) due to its implementation of an interface in a named package. It seems I have a choice between two compilation errors:

       

      1) an error referring to difference between the named package structure and the unnamed package for my module

      2) an interface not found error when I specify the full package name for the interface in the module "implements" attribute

       

      #2 seemed more promising as I figured this was just some sort of source path error. After adjusting the source path many times, though, I have been unable to get past the interface not found error. I even tried to compile the interface into a SWC and then place the SWC on the library path.

       

      Overall, the structure of the code is very simple:

       

      com.example.workers.IModule

      WorkerModule1

       

      If I go ahead and make IModule part of an unnamed package, I can get past problem #1 (avoid #2) and get it to compile, but then I do not have the ability to cast the child of the loaded module (ModuleLoader.child) to the interface in my main application to insure that it is of the right type (though I can hack around this by checking if the child has a certain property or function).

       

      Anyway, I am guessing that there might be something simple that I am missing here--i.e., some way to get the named package onto the path for my mxmlc-based compilation of the module or some way to add the named package structure to my module (adding an xmlns did not accomplish anything). In any case, any help here would be greatly appreciated.

       

      --jonathan