Adobe Flex 3 Help

Build basics

MXML and ActionScript 3.0 are compiled languages. Unlike interpreted languages such as JavaScript that can be immediately executed by their run-time environments, MXML and ActionScript 3.0 must be converted into a compiled format before they can be executed by Flash Player. This process, along with the generation of related output files, is called building.

Flex Builder automatically builds your projects whenever a file in your project is changed and saved. While you have the option of building your applications manually, this should not be necessary; however, understanding the build process and the output files that are generated will help you to diagnose and repair project configuration problems that may arise.

Flex projects Source files and embedded assets (such as images) are compiled into a single output format called SWF, which is a file that can be run directly in the stand-alone Flash Player or in a web browser through an HTML wrapper file that is also generated by the build. These files are generated into the project's output folder (by default, this is named bin but you can name it anything you like).

LiveCycle Data Services ES projects When using LiveCycle Data Services ES you have the option of creating projects that are compiled on the server. When the MXML application file is first accessed (through a web browser), it is compiled into a SWF file.

Note: Even though you can configure LiveCycle Data Services ES projects to be compiled on the server, Flex Builder compiles these projects as you develop your applications so that the compiler can validate code syntax and display error messages. These projects have no output folder option and Flex Builder does not generate output files.

ActionScript 3.0 projects Like Flex projects, ActionScript 3.0 projects compile source files and embedded assets into a SWF file.

Flex library projects For library projects, source files are components and related resources. When library projects are built, a SWC file is generated into the output folder. A SWF file is archived into a SWC file containing components, resources, and a catalog.xml file that is the manifest of the elements contained within the SWF file.

Automatic builds

In the stand-alone configuration of Flex Builder, your applications are built automatically. In the plug-in configuration, you must select the Build Automatically option. While you have the option to build your applications manually, as mentioned above, this should not be necessary. Turning off automatic builds also prevents the compiler from identifying syntax errors and displaying warning and error messages as you enter code. In other words, you will not get any feedback in the Problems view until the project is compiled; therefore, it is best to set Flex Builder to build automatically.

Advanced project build options

With the advanced build options, you can control the timing and scope of your builds. For example, you can build a single project, all projects in the workspace, or create a working set (a collection) of projects to build. All build commands are accessible from the Project menu, as shown in the following example. For more information, see Advanced build options.

Project menu: build commands

The Flex Builder compiler is incremental. It builds only those resources that have been added or affected by updates and ignores all others. This saves time and system resources. You have the option, however, to rebuild all the resources in the project. You do this by performing a clean build. You might do this if your application is behaving erratically during testing and you want to eliminate all potential sources of the problem by discarding and rebuilding all the files in your project. For more information, see Advanced build options.

If you create dependencies between separate projects in the workspace, the compiler automatically determines the order in which the projects are built, so these dependencies resolve properly. You can, however, override the default build order and manually set the order in which the projects in your workspace are built. For more information, see Building projects manually.

You can also modify the build path, application list, and compiler settings for each project in the workspace. For more information, see Building projects manually, Managing project application files and Advanced build options.

Build errors displayed in the Problems view

Errors encountered by the compiler during builds appear in the Problems view, which is included in the Development and Debugging perspectives, and in the code editor, where lines of code containing errors are marked with an x, as in the following example:

For more information about working with the Problems view, see Using the Problems view.

Eclipse environment errors in the log file

Sometimes you encounter errors thrown by the Eclipse environment. These errors most often occur when resources such as SWC files are not found at run time. In these cases, you can see the error messages in the Eclipse Error Log file. The default location of this log file on Windows is c:\Documents and Settings\user_name\workspace\.metadata\.log. For Macintosh, the default location is also in the workspace directory, but files and directories that begin with a dot are hidden by default.

Custom build scripts with Apache Ant

You can modify and extend the standard build process by using Apache Ant, which is an open-source Java-based build tool. For more information about creating custom builders, see Customizing builds with Apache Ant.

Command-line access to the Flex framework compilers

You have direct command-line access to use the Flex framework compilers (mxmlc and compc). When you install Flex Builder, the Flex framework prompt is available from the Windows start menu (Programs > Adobe). For more information, see About the command-line compilers in Building and Deploying Adobe Flex 3 Applications.