Specifications
175ADOBE FLEX 3
Building and Deploying Adobe Flex 3 Applications
Distributing SWC files
After you generate a SWC file, you can use it in your Flex applications.
You can also copy SWC files to a directory specified by the
library-path compiler option. You must store SWC
files at the top level of the user_classes directory or the directory specified by the
library-path. You cannot store
SWC files in subdirectories.
To use a SWC file when compiling components or applications from the command line or from within Flex
Builder, you specify the location of the SWC file with the
library-path compiler option.
Note: Do not store custom components or classes in the flex_root/WEB-INF/flex/libs directory. This directory is for
Adobe classes and components.
Using components in SWC files
If a component in a SWC file does not have a namespace, you can add a generic namespace identifier in your
<mx:Application> tag to use the component, as the following example shows:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:a="*">
If the component has a package name as part of its namespace, you must do one of the following:
1 Add the package name to the namespace declaration in the <mx:Application> tag; for example:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:but="mycomponents.*">
2 Create a manifest file and recompile the SWC file. You pass the manifest file to the compc compiler by using
the
namespace option. In the <mx:Application> tag, you specify only the unique namespace URI that you used
with compc. For more information on specifying a namespace for the component, see
“Compiling components
using namespaces” on page 167.
About manifest files
Manifest files map a component namespace to class names. They define the package names that the components
used before being compiled into a SWC file. They are not required when compiling SWC files, but they can help
keep your source files organized.
Manifest files use the following syntax:
<?xml version="1.0"?>
<componentPackage>
<component id="component_name" class="component_class"/>
[...]
</componentPackage>










