Projects in Flash Builder

Flash Builder groups the resources (folders and files) that constitute an application into a container called a project.

Use the Package Explorer view to add, edit, and delete project resources. You can also close projects within a workspace, import resources, and link to external resources.

Types of projects

Flash Builder supports the following various types of projects, depending on the type of application you are building.

Flex projects

Use a Flex project to build a web application or a desktop application that is based on the Flex framework. A web application runs in Adobe Flash Player, while a desktop application runs in Adobe AIR. When creating the project, you specify whether the project is for web or desktop applications.

A Flex project contains a set of properties that control how the application is built, where the built application resides, how debugging is handled, and the relationships to other projects in the workspace.

A Flex Project contains a default MXML application file. Other MXML files in the project can also be application files.

See Flex projects and Developing Applications with Flex

Flex Mobile Projects

Use a Flex Mobile Project to create an AIR application targeted for a Mobile Platform. The application is based on the Flex framework. You can use Flash Builder to preview, debug, and profile mobile applications from the desktop or on a device.

A Flex Mobile Project has a single default MXML application file. Typically, a mobile application has a set of View components that display content on a device. The default MXML application file launches the default View component.

Flash Builder uses the AIR Debug Launcher (ADL) to preview mobile applications on the desktop. Although not a true emulation, the ADL allows you to view the application layout and behavior, with options to rotate the application.

You can preview a mobile application on a device connected to the development computer’s USB port. When previewing on a device, Flash Builder exports the application to the device.

See Flex mobile projects and Developing Mobile Applications with Flex and Flash Builder.

Flex Library Projects

Use a Flex Library Project to build custom code libraries that you share between applications or distribute to other developers. Typically, you use library projects to package and distribute components and resources to other developers.

A library project generates a SWC file, which is an archive file for Flex components and other resources.

See Use Flex library projects.

ActionScript Projects

Use an ActionScript Project to create web or desktop applications that are based on either the Flash APIs or Adobe AIR APIs. When creating the project, you specify whether the project is for a web or a desktop application.

Because these projects do not use MXML to define a user interface, you cannot view the application layout and design in Design mode. You work exclusively in the source editor, the debugging tools as necessary, and then build the project into SWF files to preview and test your application.

When you create an ActionScript project or a stand-alone ActionScript file to contain functions, a class, or interface, the Flex development perspective is modified to support the ActionScript editor. The primary supporting views of the ActionScript editor are the Outline and Problems views.

See ActionScript projects.

ActionScript Mobile Projects

Use an ActionScript Mobile Project to create mobile applications that are based on the Adobe AIR API. When creating the project you specify a target Mobile Platform and some mobile applications settings. You can use Flash Builder to preview the mobile application from the desktop or on a device.

Flash Builder uses the AIR Debug Launcher (ADL) to preview, debug, and profile mobile applications on the desktop. Although not a true emulation, the ADL allows you to view the application layout and behavior, with options to rotate the application.

You can preview a mobile application on a device connected to the development computer’s USB port. When previewing on a device, Flash Builder exports the application to the device. You can use Flash Builder to debug the application exported to a device.

See Create ActionScript mobile projects.

Flash Professional Projects

Use a Flash Professional Project to edit, build, or debug FLA or XFL files created in Adobe Flash Professional. This feature allows Flash Professional developers to take advantage of the editing and debugging environment available with Flash Builder. Flash Professional projects are available in Flash Builder only if you have Flash Professional installed.

See Using Flash Builder with Flash Professional.

Flash Catalyst Compatible Projects

Use a Flash Catalyst Compatible Project if you plan to share project files with Adobe Flash Catalyst projects. This feature lets designers and developers collaborate and work in-tandem on the same project.

See Flash Catalyst compatible projects.

Manage projects

You use the Package Explorer to add and import resources into projects, export projects, and move and delete resources.

Projects in Package Explorer

All projects in a workspace are displayed in the Package Explorer, as the following example shows. The Package Explorer provides a tree view of projects from both a physical view and logical (flat) view. Using this view, you manage your projects by adding and deleting resources (folders and files), importing and linking to external resources, and moving resources to other projects in the workspace.

Highlights of the Package Explorer include:

  • Displaying ActionScript packages in either a hierarchical or flat presentation.

    Use the Package Explorer’s menu to specify the package presentation.

  • Project libraries are represented in two top-level nodes, one node for the Flex SDK and the other for referenced libraries.

    You can expand a library’s contents and open editors to view attachments.

  • Error and warning badges on Package Explorer nodes notify you of problems within a package.

  • You can limit which projects and resources are visible.

    You can create a working set (a collection of resources), create display filters, and sort resources by name and type. These options are available from the Package Explorer menus. For more information about modifying views, see Customize the workbench.

  • You can expand ActionScript, MXML, and CSS files and see a tree view of their contents.

From the Package Explorer, you can open the project resources for editing. For example, you can edit MXML and ActionScript in <fx:Script> blocks and CSS in <fx:Style> blocks, or you can switch to Design mode and visually manipulate components and controls to create the application’s layout and behavior. For more information about working with the Flash Builder editors, see Flash Builder editors and Build user interfaces.

Then you add projects, files, and folders, and organize and manage them as needed. See Projects in Flash Builder.

Most menu commands that you use in the Package Explorer view are also available from the view’s context menu.

Move a project from one workspace to another

You use a combination of deleting and importing operations to move a project from one workspace to another. When you delete a project from a workspace, you can remove it from the workspace but leave it in the file system (see Delete a project). After you remove a project from one workspace, you can import it into another.

Specify an SDK for a project

When creating a Flex project, you can specify which Flex SDK to use. However, you can later modify the SDK settings by selecting Project > Properties > Flex Compiler > Use a specific SDK.

If you want to compile your project against a version of the Flex SDK that is not available in your Flash Builder installation, you can download the SDK and add it to your installation. For example, download the SDK, and add it to Flash Builder using Project > Properties > Flex Compiler > Configure Flex SDKs.

Delete a project

When you delete a project, you remove the project from the current workspace. You can also remove the project from the file system at the same time.

Instead of deleting the project from the workspace, you can close the project. Closing the project lets you keep a reference to it in your workspace and also free some system resources. For more information, see Close and open projects.

  1. In the Package Explorer, select the project to delete.

  2. Select Edit > Delete from the main menu.

  3. Select an option:

    Also Delete Contents Under Directory
    Permanently removes the project from the workspace and the file system.

    Do Not Delete Contents
    Removes the project from the workspace but not from the file system.

Close and open projects

To save memory and improve build time without deleting a project, you can close it. When you close a project, you collapse the project and its resources, however, the name remains visible in the Package Explorer. A closed project requires less memory than an open project, and is excluded from builds. You can easily reopen the closed project.

  1. In the Flex Package Explorer, select the project to close or reopen.

  2. From the Package Explorer context menu, select Close Project or Open Project.

Switch the main application file

When you create a project, the main application file is generated for you. By default, it is named after the project. The main application file is the entry point into your applications and becomes the basis of the application SWF file. However, as you add files to your application, you might want to designate a different file as the main application file.

If you prefer to set multiple files as application files so that each application file is built in to a separate SWF file, see Manage project application files.

  1. In the Package Explorer, select the MXML application file that you want to make the main application file.

  2. From the Package Explorer context menu, select Set as Default Application.

You can manage the application files in your project by selecting Project > Properties > Flex Applications (or ActionScript Applications if you’re working with an ActionScript project).

Manage project application files

Usually, a project has a single main application file, which serves as the entry point to your application. The Flash Builder compiler uses this file to generate the application SWF file.

For example, you can have a complex application with many custom MXML components that represent distinct but interrelated application elements. You can create an application file that contains a custom component and then build, run, and test it separately.

By default, whenever you add an MXML application file to your Flex project, you can run the application, and it is added to the list of project application files. All files defined as application files must reside in your project’s source folder.

You can manage the list of application files by selecting a project and viewing its properties.

  1. In the Package Explorer, select a project.

  2. Select Project > Properties from the main menu or select Properties from the context menu.

  3. In the Project Properties dialog box, select Flex Applications (or ActionScript Applications if you are working with an ActionScript project).

  4. Add and remove application files as needed. Click OK.

Switch the workspace

You can work in only one workspace at a time. When you install and run Flash Builder for the first time, you are prompted to create a workspace, which becomes the default workspace. You can create other workspaces and switch among them by either selecting the workspace when you start Flash Builder or by selecting File > Switch Workspace.

Set Flex project properties

Each Flex project has its own set of properties. To set these properties, select the project in the Package Explorer view. Then select Project > Properties from the main menu. You can also select Properties from the context menu for the project.

You can set the following project-specific preferences in Flash Builder:

Resource
Displays general information about the project, settings for text encoding, and the operating system line delimiter.

Builders
Specifies the build tool to use. A standard builder is included in Flash Builder. You can use Apache Ant (an open-source build tool) to create build scripts or import existing Ant build scripts.

See Customize builds with Apache Ant.

Data Model
Available only with LiveCycle Data Services. Specifies the location of the data model file, which contains service and data type information for LiveCycle Data Services ES.

Data/Services
For projects that access data services, specifies whether to use the default code generator for accessing services. You can also specify whether to use a single server instance when accessing services.

See Extending service support in Flash Builder for information on extending Flash Builder to use custom code generation.

See Using a single server instance for information on using a single server instance when accessing services.

Flex Applications
Displays the names of the project files that are set as application files, which can be compiled, debugged, and run as separate applications.

See Manage project application files.

Flex Build Path
Specifies the build path, which specifies where external source and library files are located. You can modify the build path and also change the name of the output folder.

See Set up a project output folder and Build projects manually.

Flex Compiler
Specifies optional compiler preferences, such as generating an accessible SWF file, enabling compiler warnings and type checking, specifying additional compiler arguments, Flex SDK version, and sets HTML wrapper settings.

See Advanced build options.

Flex Modules
Specifies modules to build and optimize for the project. For more information about using modules in Flash Builder, see Create a separate project for modules in Flash Builder.

Flex Server
Specifies the application server type for the project. When you create a project, you specify the application server type. You can change the application server type for a project here. If you change the application server type for a project, you may not be able to access data services previously configured.

See Flex projects and Creating a Flex project to access data services.

Flex Theme
Specifies the theme to use for all applications in the project. You can specify one of the themes available with Flash Builder or import a theme.

See Apply themes.

Project References
Lists the projects that the current project references.

Run/Debug Settings
Manages launch configuration settings.

See Manage launch configurations.

Create working sets

If your workspace contains many projects, you can create a working set to group selected projects together. You can then view separate working sets in the Package Explorer and Task views and also search working sets rather than searching everything in the workspace.

Create a working set

  1. In the Package Explorer view, open the toolbar menu and select Select Working Set.

  2. Select New.

    Flash Builder provides two set types: breakpoints (used in debugging) and resources.

  3. Select the resources type and click Next.

  4. Enter the working set name and then choose the projects in the workspace that you want to include in the working set.

  5. Click Finish.

    The working set is immediately applied to the Package Explorer view and only those projects and resources contained in the set are displayed.

Display all projects in the workspace

 In the Package Explorer view, open the toolbar menu and choose Deselect Working Set.