Skip to end of metadata
Go to start of metadata

IntelliJ IDEA is capable of importing Flex and pure ActionScript projects created with Adobe Flash Builder. In this tutorial, you'll find out how to:

  1. Import a single Flash Builder project
  2. Import Flash Builder projects that were exported in *.fxp, *.fxpl or *.zip format
  3. Import multiple Flash Builder projects or a Flash Builder workspace
  4. What to do after importing
Note that there are some differences in terminology that you should keep in mind:
  • Flash Builder workspace is the equivalent of IntelliJ IDEA project.
  • Flash Builder project is the equivalent of IntelliJ IDEA Flash module.

IntelliJ IDEA Flash module contains one or more Flash build configurations. A build configuration is a set of parameters that define how to produce a SWF or SWC, an HTML wrapper or AIR descriptor, a desktop, Android or iOS package from the module sources.

1. Import a single Flash Builder project

1.1. Open a .project file

To import a single Flash Builder project, select the File | Open main menu command, or click Open Project on the IntelliJ IDEA welcome screen. Then, in the file chooser, select the .project file of interest.

Most probably, this will be it: IntelliJ IDEA will do the rest of the work itself after you press OK in the Open Project dialog.

Sometimes, however, you may be asked for additional information. If this is the case, see steps 1.2 and 1.3 for corresponding instructions.

When the project import is complete, see What to do after importing.

1.2. Configure an SDK

If you have Flash Builder installed on your computer, IntelliJ IDEA will automatically select Flex or AIR SDK from the Flash Builder installation. Otherwise, you'll be asked to select an SDK manually.

If the necessary SDK is already defined in IntelliJ IDEA, you can select this SDK from the list. (On the screenshot above, this is where [none] is shown.) Alternatively, you can configure a new SDK.

To configure a new SDK click the ellipsis button [...]. In the dialog that opens, click [+] and select Flex/AIR SDK. Then, select the location of the necessary Apache Flex SDK (previously known as Adobe Flex SDK) or standalone Adobe AIR SDK. (By this time the corresponding SDK must already be installed on your computer.)

Note that a standalone AIR SDK can be used only for pure ActionScript projects while Flex SDK is suitable for both Flex and pure AS projects because a Flex SDK installation includes an AIR SDK.

1.3. Configure path variables

Flash Builder project files may contain paths that are set relative to path variables. If IntelliJ IDEA fails to resolve such relative paths automatically, you'll be asked to configure unknown path variables. For example, DOCUMENTS usually refers to the Flash Builder workspace folder, and if IntelliJ IDEA fails to detect the path to the workspace the following dialog will appear.

Click the Edit icon and select the required path.

If you have no idea where an unresolved path variable should point, click Cancel in this dialog. Then, after the import is complete, you should check your project structure and, probably, fix some of the library paths on the Project Structure | Modules | [imported Flash module] | [Flash build configuration subnode] | Dependencies tab.

When the project import is complete, see What to do after importing.

2. Import Flash Builder projects that were exported in *.fxp, *.fxpl or *.zip format

Flash Builder lets you export its projects into a single archive file. The archive file extension may be *.fxp (in the case of a Flex project), *.fxpl (for a library project) or *.zip (for a pure ActionScript project). The exported archive file may contain more than one project if there are dependencies between the Flash Builder projects (e.g. an app may depend on a lib).

2.1. Open a *.fxp, *.fxpl or *.zip file

To import Flash Builder project(s) from a *.fxp, *.fxpl or *.zip file, select the File | Open main menu command, or click Open Project on the IntelliJ IDEA welcome screen. Then, in the file chooser, select the *.fxp, *.fxpl or *.zip file containing the Flash Builder project(s) of interest.

2.2. Specify project location

You'll be asked about the location where imported project(s) should be extracted.

Note that if the *.fxp file contains a single Flash Builder project, it will be extracted exactly to the location that you specify. But if the *.fxp file contains more than one project, IntelliJ IDEA will create corresponding subfolders and extract each project into its own subfolder.

Most probably, this will be the last step you have to take, and you'll get the IntelliJ IDEA project ready after pressing OK in the Open Project dialog (see the screenshot above).

Sometimes, however, you may be asked for information about the SDK and path variables. If this is the case, see steps 1.2 and 1.3 for corresponding instructions.

When the project import is complete, see What to do after importing.

3. Import multiple Flash Builder projects or a Flash Builder workspace

3.1. Select the Flash Builder workspace

Select File | Import Project or click Import Project on the IntelliJ IDEA welcome screen. Then, in the file chooser, select the Flash Builder workspace location, or the base folder within which you want to search for projects.

3.2. Import project from external model

At the next step, select Import project from external model, and select Flash Builder.

3.3. Set the project name

The Flash Builder workspace or project field at the next step shows the path to the folder that you have selected. You don't need to change it.

Change the project name if you don't like the suggested one.

The path in the Project files location field should be the same as the one in the Flash Builder workspace or project field.

Keep the suggested project format (.idea (directory based); shown in the Project format field).

3.4. Select the projects to import

At the next step, you can select which projects you'd like to import.

Most probably, this will be the last step you have to take, and you'll get the IntelliJ IDEA project ready after pressing Finish (see the screenshot above).

Sometimes, however, you may be asked for information about the SDK and path variables. If this is the case, see steps 1.2 and 1.3 for corresponding instructions.

When the project import is complete, see What to do after importing.

4. What to do after importing

4.1. IntelliJ IDEA project files

Now, an IntelliJ IDEA project has been created and is ready for use.

The IntelliJ IDEA project files are stored in the .idea folder; module settings are kept in the *.iml files. The contents of the .idea folder (except the workspace.xml file) and all the *.iml files may be kept under version control.

4.2. Project structure

Check your project structure in the Project Structure dialog. (To open this dialog, select File | Project Structure, or click the Project Structure icon on the main toolbar).

To see the modules that exist in your project, select Modules in the leftmost pane. Note that only the module content roots and source folders can be configured at the module level.

All Flash-specific settings are configured at the Flash build configuration level. (Build configurations are shown as subnodes of a Flash module).

Each build configuration has its own type (target platform, Flex/pure AS, output type), main class, output folder, Flex SDK, compiler options, etc. The settings are distributed among the tabs. For example, the settings for your Flex SDK are shown and configured on the Dependencies tab.

Look through the tabs to check if the project was imported correctly.

4.3. Run Configurations

To manage your run configurations and their settings, use the Run/Debug Configurations dialog. To open this dialog,  select Run | Edit Configurations.

4.4. Develop with pleasure!

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.