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!
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
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
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
Compile the application SWF file:mxmlc MyApplication.mxml
Compile the module:mxmlc -load-externs=report.xml