Adobe Flex 3 Help

Getting started

August 25, 2008: Fixed URL
You can download the compiler module from the following location:

http://opensource.adobe.com/wiki/display/flexsdk/Downloads

Versions and requirements

The compiler module comes in the following versions:

  • Flex 3 compiler ISAPI filter for Windows (EXE)
  • Flex 3 compiler module for Apache for Windows (EXE)
  • Flex 3 compiler module for Apache for Macintosh (ZIP)
  • Flex 3 compiler module for Apache for Linux and other platforms (ZIP)

The Windows and Macintosh installers include the Flex SDK and the required JRE. The Linux installer requires that you install the following separately:

  • Flex SDK 2.0.1 or later
  • JRE 1.4.2 or later

All of these versions require one of the following web servers:

  • Apache 1.x/2.x (Windows, MacOS, or Linux)
  • IIS version 5.1, 6, or 7 (Windows)

Installing the web-tier compiler

To install the compiler module, run the appropriate installer. The installer prompts you for the locations of various assets, including:

  • Where to install the compiler module and SDK -- The installer installs the Flex SDK and the compiler module. This document refers to this location as module_install_dir. On Windows, the default location is c:\Program Files\flex_sdk. On MacOS, the default location is /Applications/flex_sdk.
  • (Apache) Configuration files -- The location of your Apache configuration files. This is not the document root of the web server, but rather the location of the web server's configuration files. For Apache on Windows XP, the default location is C:\Program Files\Apache Software Foundation\Apache2.2\conf.
  • Web server root -- The location of your web server root. This is the document root of the web server. For IIS on Windows XP, the default location is C:\Inetpub\wwwroot. For Apache on Window XP, the default location is C:\Program Files\Apache Software Foundation\Apache2.2\htdocs.

Linux users must use manual installation. The manual installation download does not include the SDK or JRE. For more information, see the readme file that is included in the download.

The compiler module installation sets the JAVA_HOME environment variable, if it is not already set. If it is set, then the compiler module verifies that the JRE version to which that variable points is supported by the module.

Verifying the installation

To verify that the web-tier compiler installation was successful, see Using the web-tier compiler.

The installer modifies your web server's configuration. On Apache, the installer adds the following to the end of your httpd.conf file:

LoadModule flex_module modules/mod_flex.dll
AddHandler flex .mxml

Do not modify the Flex settings in this file. For more information about the httpd.conf file, see the Apache documentation.

View the filter on IIS

  1. From the Administrative Tools section of the control panel, open the Internet Information Services manager.
  2. Right-click the Default Web Site and select Properties. The Default Web Site Properties dialog box appears.
  3. Select the ISAPI Filters tab. The tab should list the Flex module.

You can use ISAPI Filters tab to disable the Flex filter without uninstalling it.

On IIS, the installer installs an ISAPI filter on the Default Web Site. You can add the filter to any web site running on IIS.

Install the ISAPI filter on web sites other than the Default Web Site

  1. From the Administrative Tools section of the control panel, open the Internet Information Services manager.
  2. Right-click the web site and select Properties. The Web Site Properties dialog box appears.
  3. Select the ISAPI Filters tab.
  4. Click the Add button. The Filter Properties dialog box appears.
  5. In the Filter Name text box, enter a name for the filter.
  6. In the Executable text box, browse to the location of the DLL that was installed on the Default Web Site.
  7. Click OK and then click OK again to add the new filter to your web site.

Uninstalling the web-tier compiler

 Run the uninstall executable in the module_install_dir/uninstall directory.

On Apache, the uninstaller utility attempts to restore the httpd.conf file by using a backup. If any changes were made to the httpd.conf file between the time of the compiler module installation and the time of the uninstallation, answering Yes to the prompt erases those changes.

Using the web-tier compiler

After installing the web-tier compiler and restarting your web server, you can request an MXML file from your web server and receive a compiled SWF file in return.

Use the web-tier compiler

  1. (Windows) Reboot your computer.
  2. Start or restart the web server.
  3. Copy your MXML file to the web server's document root. For Apache, the default document root is Apache_install_dir/htdocs. For IIS, it is IIS_install_dir/wwwroot.
  4. Request the MXML file in your web browser. For example:
    http://localhost/Main.mxml
    
    

    The module returns a generated wrapper that embeds the SWF file.

Map the project's workspace to a virtual path in your web server

  1. In Apache, set the Alias directive in the httpd.conf file:
    Alias /flex "C:/Documents and Settings/knizia/workspace/MyBasicProject" 
    
    

    Alternatively, you can define your Adobe® Flex® Builder™ project directly under the web root.

  2. In Flex Builder, select Run > Run to change the URL to launch in your project. The Run dialog box appears.
  3. Under URL or Path to Launch, deselect the Use Defaults option.
  4. Enter your request URL in the Debug and Run text boxes. For example:
    http://localhost/flex/MyBasicProject.mxml 
    http://localhost/flex/MyBasicProject.mxml 
    
    

    Flex Builder appends ?debug=true to the URL when it launches the browser. This query string parameter triggers a compilation with the debug compiler options enabled.