2 Replies Latest reply on Jan 11, 2007 5:34 PM by sharpbeans

    import problem in module

      I got Flex Builder 2.0.1 recently and test the module feature of it. However, I am puzzled by the import in the module.

      When I create a application and a module to load. Each of them need import some UI controls such as mx.control.RichTextEditor. I was obliged to import the Class in them each to make them able to compile. But in that condition, the size of them both quite large for they both import the UI controls. It sounds hard to understand why adobe do this. Any one have a good solution? Thank you!
        • 1. Re: import problem in module
          FlightGuy Level 1
          Nothing wrong with it - you're not including the content of the library - like java you're just making the content available to the compiler.

          • 2. Re: import problem in module
            sharpbeans Level 1
            Thank you, Tim!

            I got the answer from the document of Adobe(^_^)

            Controlling module size:

            Module size varies based on the components and classes that are used in the module. By default, a module includes all framework code that its components depend on, which can cause modules to be large by linking classes that overlap with the application's classes.

            To reduce the size of the modules, you can instruct the module to externalize classes that are included by the application. This includes custom classes and framework classes. The result is that the module only includes the classes it requires, while the framework code and other dependencies are included in the application.

            To externalize framework classes, you generate a linker report from the application that loads the modules, by using mxmlc commands. You then use this report as input to the module's load-externs compiler option.

            To create a linker report:
            Generate the linker report:mxmlc -link-report=report.xml MyApplication.mxml

            Compile the application SWF file:mxmlc MyApplication.mxml

            Compile the module:mxmlc -load-externs=report.xml MyModule.mxml