Building overview

About the Flex development tools

Configuration files

You must be familiar with the ways to configure your development environment. Flex Software Development Kit (SDK) primarily provide XML files that you use to configure the settings. The flex-config.xml file defines the default compiler options for the compilers.

In addition to server and compiler configuration settings, you can also modify the messaging and data management settings, the JVM heap size, Adobe® Flash® Player settings, and logging and caching settings.

For more information about configuring your Flex SDK environment, see SDK configuration.

Compilers

Flex includes application compilers and component compilers. You use the application compilers to compile SWF files from MXML and other source files. You use the component compilers to compile SWC files from component files. You can then use SWC files as dynamic or static libraries with your Flex applications.

The application compilers take the following forms:

  • mxmlc command-line compiler. You launch the mxlmc compiler from the command line to create a SWF file that you then deploy to a website.

  • fcsh compiler shell. Provides an optimized environment for using the mxmlc command-line compiler. For more information, see Using fcsh, the Flex compiler shell.

The component compilers take the following form:

  • compc command-line compiler. You open the compc compiler from the command line to create SWC files. You can use these SWC files as static component libraries, themes, or runtime shared libraries (RSLs).

For information on using the compilers, see Flex compilers.

Debugger

To test your applications, you run the application SWF files in a web browser or the stand-alone Flash Player. If you encounter errors in your applications, you can use the debugging tools to set and manage breakpoints in your code; control application execution by suspending, resuming, and terminating the application; step into and over the code statements; select critical variables to watch; evaluate watch expressions while the application is running; and so on.

Flex provides the following debugging tools:

The fdb command-line debugger

The fdb command-line debugger provides a command-line interface to the debugging experience. With fdb, you can step into code, add breakpoints, and check variables. For more information, see Command-line debugger.

AIR Debug Launcher (ADL)

ADL is a command line debugger for Adobe® AIR™ applications.

Loggers

You can log messages at several different points in a Flex application's life cycle. You can log messages when you compile the application, when you deploy it to a web application server, or when a client runs it. You can log messages on the server or on the client. These messages are useful for informational, diagnostic, and debugging activities.

Flex includes the following logging mechanisms that you use when working with Flex applications.

Client-side logging

When you use the debugger version of Flash Player or start your AIR application using AIR Debug Launcher, you can use the trace() global method to write out messages or configure a TraceTarget to customize log levels of applications for data services-based applications. For more information, see Client-side logging and debugging.

Compiler logging

When compiling your Flex applications from the command line, you can view deprecation and warning messages, and sources of fatal errors. For more information, see Compiler logging.

About application files

Flex applications can use many types of application files such as classes, component libraries, theme files, and Runtime Shared Libraries (RSLs).

Component classes

You can use any number of component classes in your Flex applications. These classes can be MXML or ActionScript files. You can use classes to extend existing components or define new ones.

Component classes can take the form of MXML, ActionScript files, or as SWC files. In MXML or ActionScript files, the components are not compiled but reside in a directory structure that is part of your compiler's source path. SWC files are described in SWC files.

Component libraries are not dynamically linked unless they are used in a Runtime Shared Library (RSL). Component classes are statically linked at compile time, which means that they must be in the compiler's source path. For information about creating and using custom component classes, see Custom Flex components.

SWC files

A SWC file is an archive file for Flex components and other assets. SWC files contain a SWF file and a catalog.xml file. The SWF file inside the SWC file implements the compiled component or group of components and includes embedded resources as symbols. Flex applications extract the SWF file from a SWC file, and use the SWF file's contents when the application refers to resources in that SWC file. The catalog.xml file lists of the contents of the component package and its individual components.

You compile SWC files by using the component compiler, compc. SWC files can be component libraries, RSLs, theme files, and resource bundles.

To include a SWC file in your application at compile time, it must be located in the library path. For more information about SWC files, see About SWC files.

Component libraries

A component library is a SWC file that contains classes and other assets that your Flex application uses. The component library's file structure defines the package system that the components are in.

Typically, component libraries are statically linked into your application, which means that the compiler compiles it into the SWF file before the user downloads that file.

To build a component library SWC file, you use the include-classes, include-namespaces, and include-sources component compiler options. For more information on building component libraries, see Using compc, the component compiler.

Runtime Shared Libraries

You can use shared assets that can be separately downloaded and cached on the client in Flex. These shared assets are loaded by multiple applications at run time, but must be transferred only once to the client. These shared files are known as Runtime Shared Libraries or RSLs.

RSLs are the only kind of application asset that is dynamically linked into your Flex application. When you compile your application, the RSL source files must be available to the compiler so that it can perform proper link checking. The assets themselves are not included in the application SWF file, but are only referenced at run time.

To create an RSL SWC file, you add files to a library by using the include-classes and include-namespaces component compiler options. To use RSLs when compiling your application, you use the external-library-path, externs, load-externs, and runtime-shared-libraries application compiler options. The external-library-path, externs, and load-externs options provide the compile-time location of the libraries. The runtime-shared-libraries option provides the run-time location of the shared library. The compiler requires this for dynamic linking.

For more information, see Runtime Shared Libraries.

Themes

A theme defines the look and feel of a Flex application. A theme can define something as simple as the color scheme or common font for an application, or it can be a complete reskinning of all the components used by the application.

Themes usually take the form of a SWC file. However, themes can also be composed of a CSS file and embedded graphical resources, such as symbols from a SWF file.

Theme files must be available to the compiler at compile-time. You build a theme file by using the include-file and include-classes component compiler options to add skin files and style sheets to a SWC file. You then reference the theme SWC file when you compile the main Flex application by using the theme application compiler option.

For more information about themes, see About themes.

Resource bundles

You can package libraries of localized properties files and ActionScript classes into a SWC file. The application compiler can then statically use this SWC file as a resource bundle. For more information about creating and using resource bundles, see Localization.

Other assets

Other application assets include images, fonts, movies, and sound files. You can embed these assets at compile time or access them at run time.

When you embed an asset, you compile it into your application's SWF file. The advantage of embedding an asset is that it is included in the SWF file, and can be accessed faster than when the application has to load it from a remote location at run time. The disadvantage of embedding an asset is that your SWF file is larger than if you load the resource at run time.

The alternative to embedding an asset is to load the asset at run time. You can load an asset from the local file system in which the SWF file runs, or you can access a remote asset, typically though an HTTP request over a network.

Embedded assets load immediately, because they are already part of the Flex SWF file. However, they add to the size of your application and slow down the application initialization process. Embedded assets also require you to recompile your applications whenever your asset files change.

For more information, see Embedding assets.

Navigation

Using Flex » Developer tools

Adobe, Adobe AIR and Adobe Flash Player are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries and are used by permission from Adobe. No other license to the Adobe trademarks are granted.