Steps using SWC files in your Flex projects


To use SWC files in your Flex projects, you add them to the project’s library path. The SWC files can be located in the project, in a Flex library project, in a shared folder within the workspace, or any other location that has been linked to the project (using a shared folder that was added to the project’s source path, for example).

When you use SWC files in applications, there are configuration options that determine whether they are statically or dynamically linked to the application, merged into the application SWF file, or external to it and accessed separately at run time.

Add an SWC file to the library path

  1. With a project selected in the Flex Navigator view, select Project > Properties > Flex Build Path.
  2. Click on the Library Path tab.
  3. Select any of these options to add SWC files:

Add Project Adds a Flex library project.

Add SWC Folder Lets you add a folder that contain SWC files.

Add SWC Adds a compiled SWC file.

Add Flex SDK Lets you add other Flex SDKs. If your project already has a Flex SDK in its library path, this button is disabled. If you remove the existing Flex SDK from your library path, the button is enabled. When you click this button, a Flex SDK node is added, but you are not prompted which one is added. To control which Flex SDK to use, select Project > Properties > Flex Compiler.

  1. Enter or browse to and select the location of the SWC file, project, or folder. Click OK.

The SWC file, library project, or folder is added to the library path.

Merge the SWC file into the application SWF file when compiled

  1. With a project selected in the Flex Navigator view, select Project > Properties > Flex Build Path.
  2. Click on the Library Path tab, and then select and expand the SWC file entry to display the SWC options.
  3. Double-click the Link Type option. The Library Path Items Options dialog box appears.
  4. Select the Merged into Code option, and click OK.

This procedure is the equivalent of using the library-path compiler option.

Set the SWC file as an external library file

  1. With a project selected in the Flex Navigator view, select Project > Properties > Flex Build Path.
  2. Select the Library Path tab, and then select and expand the SWC file entry to display the SWC options.
  3. Double-click the Link Type option. The Library Path Items Options dialog box appears.
  4. Select the External option, and click OK.

This procedure is the equivalent of using the external-library-path compiler option.

Use the SWC file as an RSL

  1. With a project selected in the Flex Navigator view, select Project > Properties > Flex Build Path.
  2. Select the Library Path tab, and then select and expand the SWC file entry to display the SWC options.
  3. Double-click the Link Type option. The Library Path Items Options dialog box appears.
  4. Select the Run-time Shared Library (RSL) option.
  5. Enter the URL where the SWC library will reside when the application is deployed.
  6. (Optional) To extract the SWF file in the SWC file when it is placed in the deploy location, select the Automatically extract swf to deployment path option.
  7. Click OK.

Using the SWC files as an RSL simplifies the process for using RSLs manually. To do this, you extract the SWF file from the SWC file and set the values of the runtime-shared-library-path compiler option.

For more information about using SWC files as an RSL, see Using Runtime Shared Libraries in Building and Deploying Adobe Flex 3 Applications.

~ by mjcprasad2000 on July 22, 2009.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: