Specifications

CHAPTER 8
168
The namespace option matches a namespace (such as “http://www.adobe.com/2006/mxml”) with a manifest file.
The
include-namespaces option instructs compc to include all the components listed in that namespaces
manifest file in the SWC file.
After you define the manifest file, you can compile the SWC file. The following command-line example compiles
the components into the “http://mynamespace namespace:
compc -source-path .
-output c:/jrun4/servers/flex2/flex/WEB-INF/flex/user_classes/MyButtons.swc
-namespace http://mynamespace SimpleManifest.xml
-include-namespaces http://mynamespace
In a configuration file, these options appear as the following example shows:
<compiler>
<source-path>
<path-element>.</path-element>
</source-path>
<output>c:/jrun4/servers/flex2/flex/WEB-INF/flex/user_classes/MyButtons.swc</output>
<namespaces>
<namespace>
<uri>http://mynamespace</uri>
<manifest>SimpleManifest.xml</manifest>
</namespace>
</namespaces>
</compiler>
<include-namespaces>
<uri>http://mynamespace</uri>
<include-namespaces>
In your Flex application, you can access the components by defining the new namespace in the
<mx:Application> tag, as the following example shows:
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:a="http://mynamespace">
<a:MyButton/>
<a:MyOtherButton/>
</mx:Application>
Components in multiple namespaces
You can use the compc compiler to compile components that use multiple namespaces into a SWC file. Each
namespace must have its own manifest file.
The following command-line example compiles components defined in the AcmeManifest.xml and SimpleMan-
ifest.xml manifest files: