Specifications
167ADOBE FLEX 3
Building and Deploying Adobe Flex 3 Applications
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:mine="mypackage.*"
xmlns:acme="acme.*">
<mine:MyButton/>
<acme:CustomComboBox/>
</mx:Application>
Compiling components using namespaces
When you have many components in one or more packages that you want to add to a SWC file and want to
reference from an MXML file through a custom namespace, you can list them in a manifest file, then reference
that manifest file on the command line. Also, you can specify a namespace for that component or define multiple
manifest files and, therefore, specify multiple namespaces to compile into a single SWC file.
When you use manifest files to define the components in your SWC file, you specify the namespace that the
components use in your Flex applications. You can compile all the components from one or more packages into a
single SWC file. If you have more than one package, you can set it up so that all packages use a single namespace
or so that each package has an individual namespace.
Components in a single namespace
In the manifest file, you define which components are in a namespace. The following sample manifest file defines
two components to be included in the namespace:
<?xml version="1.0"?>
<!-- SimpleManifest.xml -->
<componentPackage>
<component id="MyButton" class="MyButton"/>
<component id="MyOtherButton" class="MyOtherButton"/>
</componentPackage>
The manifest file can contain references to any number of components in a namespace. The class option is the
full class name (including package) of the class. The
id property is optional, but you can use it to define the
MXML tag interface that you use in your Flex applications. If the compiler cannot find one or more files listed in
the manifest, it throws an error. For more information on using manifest files, see “About manifest files” on
page 175.
On the command line, you define the namespace with the
namespace option; for example:
-namespace http://mynamespace SimpleManifest.xml
Next, you target the defined namespace for inclusion in the SWC file with the include-namespaces option; for
example:
-include-namespaces http://mynamespace










