Specifications

CHAPTER 8
176
For example:
<?xml version="1.0"?>
<componentPackage>
<component id="MyButton" class="package1.MyButton"/>
<component id="MyOtherButton" class="package2.MyOtherButton"/>
</componentPackage>
In a manifest file, the id property of each <component> tag must be unique. It is the name you use for the tag in
your Flex applications. For example, you define the
id as MyButton in the manifest file:
<component id="MyButton" class="asbutton.MyButton"/>
In your Flex application, you use MyButton as the tag name:
<local:MyButton label="Click Me"/>
The id property in the manifest file entry is optional. If you omit it, you can use the class name as the tag. This is
useful if you have two classes with the same name in different packages. In this case, you use the manifest to define
the tags, as the following example shows:
<?xml version="1.0"?>
<componentPackage>
<component id="BoringButton" class="boring.MyButton"/>
<component id="GreatButton" class="great.MyButton"/>
</componentPackage>
Some SWC files consist of multiple components from different packages, so compc includes a manifest file with
your SWC file in those cases to prevent compiler errors.
When compiling the SWC file, you specify the manifest file by using the namespace and the include-
namespaces
options. You define the namespace and its contents with the namespace option:
-namespace http://mynamespace mymanifest.xml
Then you identify that namespaces contents for inclusion in the SWC file:
-include-namespaces http://mynamespace
Using fcsh, the Flex compiler shell
The fcsh (Flex Compiler Shell) utility provides a shell environment that you use to compile Flex applications,
modules, and component libraries. It works very similarly to the mxmlc and compc command line compilers, but
it compiles faster than the mxmlc and compc command-line compilers. One reason is that by keeping everything
in memory, fcsh eliminates the overhead of launching the JVM and loading the compiler classes. Another reason
is that compilation results (for example, type information) can be kept in memory for subsequent compilations.