Adobe Flex 3 Help

Customizing project builds

Flex Builder allows you to build your applications automatically using the default project settings. This is the recommended approach to building your applications. You can, however, customize project builds to suit your needs. For example, you may want to change the default output folder or modify the compiler options.

Enabling and disabling automatic builds

In the stand-alone configuration of Flex Builder, your projects are built automatically. In the plug-in configuration, you need to select this option yourself. Flex Builder is designed to automatically build your projects; turning this option off prevents the compiler from identifying syntax errors and displaying warning and error messages as you enter code. For more information about building your projects manually, see Building projects manually.

Do one of the following:

  • Select Project > Build Automatically.

    Project > Build Automatically

  • Open the Preferences dialog and select the General > Workspace. Select or deselect the Build Automatically option.

The Build Automatically option affects all projects in the workspace.

Setting up a project output folder

When you create a project in Flex Builder, by default, the build output is generated into the output folder. This does not apply to LiveCycle Data Services ES projects that use the server compile option because the application is compiled on the server when you run it.

You can change the name of this folder when you create the project or after the project is created. You can either create a folder or select an existing folder in the workspace.

  1. In the Flex Navigator view, select a project.
  2. Right-click (Control-click on Macintosh) and select Properties from the context menu.

    The Project Properties dialog box appears.

  3. Select the Flex Build Path properties page.
  4. Change the existing output folder by entering a new name or by navigating to an existing folder in your project and selecting it.

Note: You cannot change the output folder of a LiveCycle Data Services ES application in this manner because its location is controlled by the Flex server and is accessible only through the project's Flex-config.xml file.

  1. Click OK.

    The existing output folder is replaced by the new output folder.

Important: When you change the name of the output folder, the original output folder and all of its contents will be deleted. You will need to rebuild the project to regenerate the application SWF and HTML wrapper files.

Modifying a project build path

Each project has its own build path, which is a combination of the source path and the library path. (Library project build paths are a little more complex. For more information, see About library projects.) The source path is the location of the project MXML and ActionScript source files. The library path is the location of the base Flex framework classes and any custom Flex components that you have created, in the form of SWC files.

Modify the source path

  1. Select a project in the Flex Navigator view.
  2. Right-click (Control-click on Macintosh) and select Properties from the context menu. The Project Properties dialog box appears.
  3. Select the Flex Build Path properties page. (If you're working with an ActionScript project, select the ActionScript Build Path properties page.)
  4. Add a folder to the source path by clicking the Add Folder button.
  5. Enter a name for the folder or click the Browse button to select the location of the custom classes.

    You can also use path variables rather than entering the full path to the file system. You can either enter the name of an existing path variable or create a new path variable; for more information, see Creating a path variable.

  6. Modify the source path as needed, and click OK.

Modify the library path

  1. Follow steps 1 through 3 of the previous procedure to access the Flex Build Path properties page.
  2. Click the Library Path tab.

    The library path contains references to the Flex framework classes, which are contained in SWC files. A SWC file is an archive file for Flex components and other assets (for more information, see Using SWC files in your projects).

    You can edit the path to the framework or, if you created custom Flex components, add new folders or SWC files to the library path. You can also remove items from the path.

  3. Modify the library path as needed, and click OK.

Creating a path variable

Rather than linking to resources by entering the full path to the local or network folder where you store your files, you can define path variables. For example, you can define a path variable called Classes and then set the path to a folder on the file system. You then select Classes as the location of the new linked folder. If the folder location changes, you can update the defined path variable with the new location and all the projects that are linked to Classes continue to access the resources.

Set or create a path variable

  1. Select a project in the Flex Navigator view.
  2. Right-click (Control-click on Macintosh) and select Properties from the context menu. The Project Properties dialog box appears.
  3. Select the Flex Build Path properties page. (If you're working with an ActionScript project, select the ActionScript Build Path properties page.)
  4. You can create a path variable for any item on the path (this includes folders in the source path and SWC folders, projects, and SWC files in the library path). As an example, on the Source Path tab select the Add Folder button. The Add Folder dialog box appears.
  5. Enter a path variable using the following format: ${pathvariablename}.

Note: If the variable does not already exist, the path entry will fail. The list of existing resource variables is available by selecting Window > Preferences from the main menu and then selecting General > Workspace > Linked Resources. You can also manage linked resource variables on this properties page.

  1. Click OK to add the path variable to the path.