Adobe® Flash® Builder™ is an integrated development environment (IDE) for building cross-platform, rich Internet
applications (RIAs) for the desktop and a wide variety of mobile devices. Flash Builder also includes testing, debugging,
and profiling tools that lead to increased levels of productivity and effectiveness.
Flash Builder is built on top of Eclipse, an open-source IDE, and provides all the tools required to develop applications
that use the Flex framework and ActionScript 3.0. Flash Builder runs on Microsoft Windows and Apple Mac OS X,
and is available in several versions. Installation configuration options let you install Flash Builder as a set of plug-ins
in an existing Eclipse workbench installation or create a stand-alone installation that includes the Eclipse workbench.
Applications you can build with Flash Builder
You can build applications that use the Adobe Flex® framework, MXML, Adobe Flash Player, Adobe AIR, ActionScript
3.0, and ADEP (Adobe Digital Enterprise Platform) Data Services, and the Adobe® Flex® Charting components:
• Flex projects - Create Flex projects that can work with any backend server technology, including Adobe
ColdFusion®, ADEP Data Services, and PHP.
See “Flex projects” on page 81 and “Developing Applications with Flex” on page 166.
1
• ActionScript projects - Create ActionScript projects that use the Flash API (not the Flex framework).
See “ActionScript projects” on page 84.
• Mobile projects - Create Flex mobile applications for the Google Android platform and ActionScript mobile
applications for the Apple iOS platform.
See “Flex mobile projects” on page 83 and “Create ActionScript mobile projects” on page 84.
For more information on developing mobile applications with Flex and Flash Builder, see Developing Mobile
Applications with Flex and Flash Builder.
• Library projects - Create custom code libraries that you can deploy as component library (SWC) files to share
among your applications or distribute to other developers.
See “Use Flex library projects” on page 211.
• Flash Professional projects - Create Flash Professional projects to edit and debug Flash FLA or XFL files created
with Flash Professional CS5.
See “Using Flash Builder with Flash Professional” on page 227.
• Flash Catalyst compatible projects - Create Flash Catalyst compatible projects to let designers and developers
collaborate and work on the same project. You can easily share a Flash compatible project between Flash Builder
and Flash Catalyst through FXP or FXPL files.
See “Flash Catalyst compatible projects” on page 85.
Read about the workflows between Flash Builder and Flash Catalyst in the article, Understanding Flash Catalyst
and Flash Builder workflows by Adobe Product Manager, Jacob Surber.
• Custom MXML components - Create custom components and then easily access them using the Flash Builder
Components view.
Last updated 11/28/2011
USING FLASH BUILDER
About Flash Builder
See “Create custom MXML components” on page 215.
You can also create custom ActionScript components. See “Create an ActionScript class” on page 38.
Features that accelerate application development
Flash Builder has the tools you need to develop applications that use the Flex framework and ActionScript 3.0. You can:
• Access data services - Use Flash Builder tools and wizards to create applications that access remote data services.
See Accessing data services overview.
• Customize the Flash Builder workbench - Customize the workbench to suit your individual development needs.
For example, you can arrange the interface to include your favorite tools in a specific layout.
See “Customize the workbench” on page 240.
• Edit code - Write and edit your application source code using the code development tools in Flash Builder. The
code development tools include code refactoring, code hinting, streamlined code navigation, and automatic syntax
error checking, and other features.
See “Code Development Tools in Flash Builder” on page 44.
2
• Build a user interface - Use the MXML editor in Design mode to design applications using layout options, to drag
components onto the design canvas and then reposition and resize them as needed, to simplify using view states,
and so on.
See “Build user interfaces” on page 167.
• Publish source code - Publish your application source code so that users and other developers can view it .
See “Publish source code” on page 108.
• Manage projects, folders, files, and other resources - Create, modify, and delete projects and resources, link to
resources outside your project, and so on.
See “Projects in Flash Builder” on page 30 and “Project resources” on page 37.
Features for running and debugging projects
Flash Builder includes building, testing, debugging, and profiling tools that help increase your productivity:
• Build projects - Flash Builder automatically compiles and builds your applications for debugging or production
release. You can also create custom build scripts using Apache Ant.
See “Build projects” on page 93.
• Run applications and manage launch configurations - Run your applications in a web browser, AIR, or the stand-
alone Flash Player. Create custom launch configurations to control how your applications run.
See “Run and debug applications” on page 109 and “Manage launch configurations” on page 110.
• Debug applications - Debug your applications using the integrated debugging tools.
See “Debugging Tools in Flash Builder” on page 123.
• Run and debug mobile applications - Run and debug your applications on the desktop or on a device.
See Run and debug mobile applications.
Last updated 11/28/2011
USING FLASH BUILDER
About Flash Builder
• Profile applications - Identify performance bottlenecks and memory leaks by using the profiling tools in Flash
Builder.
See “Profiling Tools in Flash Builder” on page 132.
• Monitor applications that access data services - Use the Network Monitor to generate a detailed audit trail of all
data passed between your application and the back end .
See “Monitor applications that access data services” on page 207.
Flash Builder versions
Flash Builder is available in two versions: Standard and Premium.
Flash Builder Standard Flash Builder Standard provides a full-featured IDE that allows you to create applications
using the Flex framework and Flash API. Flash Builder Standard also includes MXML, ActionScript, and CSS editors,
as well as debugging tools. Flash Builder Standard provides a library of interactive charts and graphs that enable you
to create rich data dashboards, interactive data analysis, and data visualization components.
Flash Builder Premium In addition to the Standard version features, Flash Builder Premium includes memory and
performance profiling and automated testing tools. Use the Network Monitor to view the data that flows between a
client application and a data service. The FlexUnit test environment allows you to generate and edit repeatable tests.
The repeatable tests can be run from scripts or directly within Flash Builder or outside the Flash Builder environment.
The Command Line Build feature allows you to synchronize a developer’s individual build settings with a nightly
build.
3
Flash Builder for PHP Standard Flash Builder for PHP Standard provides a full-featured PHP IDE that includes Flash
Builder Standard integrated with Zend Studio 8. You can build mobile, web, and desktop applications using PHP, Flex,
and ActionScript.
Flash Builder for PHP Premium In addition to Standard version capabilities, Flash® Builder™ for PHP Premium
includes professional testing tools, including profilers, network monitoring, an automated testing framework,
integration with FlexUnit testing, and Command Line Build support.
For more information on Flash Builder for PHP, see Introducing Flash Builder for PHP.
Flash Builder configurations
Flash Builder provides a single downloadable installer with the following two configuration options:
Stand-alone configuration Installs Flash Builder as a stand-alone integrated development environment (IDE). The
stand-alone configuration is created specifically for developing applications that use the Flex framework and
ActionScript 3.0. This configuration is ideal for new users and users who intend to develop applications using only the
Flex framework and ActionScript 3.0.
Plug-in configuration Configures Flash Builder to run as a plug-in within an existing Eclipse™ installation. You must
have Eclipse 3.6 32 bit (Windows) or Eclipse 3.6 Cocoa 32 bit (Mac) or a higher version of Eclipse installed on your
computer to run the plug-in configuration.
Last updated 11/28/2011
USING FLASH BUILDER
About Flash Builder
The Flash Builder plug-in and stand-alone configurations provide the same functionality. If you aren't sure which
configuration to use, follow these guidelines:
• If you already have Eclipse 3.6 or a higher version installed, use the plug-in configuration to add Flash Builder
features to your existing copy of Eclipse.
• If you don't have Eclipse installed and your primary focus is on developing Flex and ActionScript applications, use
the Flash Builder stand-alone configuration. This configuration also allows you to install other Eclipse plug-ins to
expand the scope of your development work in the future.
For detailed information about installing Flash Builder, see the Flash Builder 4.6 release notes.
Adobe Community Help Client (CHC)
Flash Builder uses the Adobe Community Help Client (CHC) as the search engine. The CHC is an AIR-based
application that replaces the Eclipse Help engine for Flash Builder and is the platform for the next generation of Adobe
Help delivery. CHC features include:
• Always online
If you have a network connection, the CHC accesses content from the web. The CHC ensures that you access the
most up-to-date-material. It can also work in local mode if there is no Internet connection.
4
• Search-centric
Use Community Help search, adobe.com search, or local search. Community Help search aggregates resources,
including resources from third-party sites. adobe.com search includes refinements to narrow your scope.
• In-context navigation
Provides a dynamically generated set of related links for key pages.
• Rating and commenting
Comment on, rate, and contribute to Help content and Adobe online resources from within the CHC. You need a
valid Adobe ID to provide any feedback and rating.
Last updated 11/28/2011
Chapter 2: Getting Started With Flash
Builder
Flash Builder workbench
The Flash Builder workbench is a full-featured development environment to assist you in developing applications that
use the Adobe Flex® framework, and ActionScript 3.0. You can develop applications for deployment on Adobe Flash
Player, desktop applications for deployment on Adobe AIR®, and mobile applications for deployment on various
mobile devices.
The information required to use Flash Builder is contained in the Flash Builder documentation. If you are using other
Eclipse plug-ins (such as CVS or Java) with Flash Builder, or you want to extend the Flash Builder plug-ins, see
Flash Builder Extensibility Reference.
Workbench The term workbench refers to the Flash Builder development environment that contains all the tools to
develop applications. The workbench contains three primary elements: perspectives, editors, and views. You use all
three in various combinations at various points in the application development process.
Adobe
5
Note: For more information about some of the Eclipse workbench features, see the Eclipse Workbench User’s Guide at
http://help.eclipse.org/help31/index.jsp.
Perspective A perspective is a group of views and editors in the workbench. Flash Builder contains two perspectives:
The Flash Development perspective for developing applications, and the Flash Debug perspective for debugging
applications. Flash Builder Premium also contains the Flash Profiling perspective.
If you use the Flash Builder plug-in configuration (see “Flash Builder configurations” on page 3), your workbench can
contain additional perspectives such as a Java perspective that contains editors and views used to develop Java
applications.
See “Flash Builder perspectives and views” on page 6.
Editor An editor lets you edit various file types. The editors available to you depend on the number and type of Eclipse
plug-ins installed. Flash Builder contains editors for writing MXML, ActionScript 3.0, and Cascading Style Sheets
(CSS) code.
See “Flash Builder editors” on page 18and “Code Development Tools in Flash Builder” on page 44.
Views A view typically supports an editor. For example, when editing MXML, the Components and Flex Properties
views are also displayed in the Flash Development perspective. These views support the development of applications
and are therefore displayed when an MXML file is opened for editing.
See “Work with views” on page 17.
The term view is synonymous with the term panel as it is used in earlier versions of Flash Builder, Adobe
Dreamweaver®, and other Adobe development tools.
Workspace Not to be confused with workbench, a workspace is a defined area of the file system that contains the
resources (files and folders) that make up your application projects. You can work with only one workspace at a time;
however, you can select a different workspace each time you start Flash Builder.
See “Projects in Flash Builder” on page 30.
Resource The term resource is used generically to refer to the files and folders within the projects in a workspace.
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
See “Project resources” on page 37.
Project All of the resources that make up your applications are contained within projects. You cannot build an
application in Flash Builder without first creating a project. Flash Builder supports various types of projects, depending
on the type of application you are building.
See “Types of projects” on page 31 and “Using Projects in Flash Builder” on page 81.
Launch configuration A launch configuration is created for each of your projects, and it defines project settings that
are used when running and debugging your applications. For example, the names and locations of the compiled
application SWF files are contained in the launch configuration, and you can modify these settings.
See “Manage launch configurations” on page 110.
More Help topics
“Customize the workbench” on page 240
Flash Builder perspectives and views
To support a particular task or group of tasks, editors and supporting views are combined into a perspective. When you
open a file that is associated with a particular perspective, Flash Builder automatically opens that perspective.
6
The stand-alone configuration of Flash Builder contains three perspectives:
• Flash Development
See “The Flash Development perspective” on page 7.
• Flash Debugging
See “The Flash Debug perspective” on page 123.
• Flash Profiling
See “The Flash Profiling perspective” on page 132.
Note: The Flash Profiling perspective is available with Flash Builder Premium.
Open and switch perspectives
Perspectives change automatically to support the task at hand. For example, when you create a Flex project, the
workbench switches to the Development perspective. When you start a debugging session, the Flash Debug
perspective is displayed when the first breakpoint is encountered.
You can also manually switch perspectives yourself by selecting Window > Open Perspective. Or, you can use the
perspective bar, which is located in the main workbench toolbar.
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
When the perspective opens, its title changes to display the name of the perspective you selected. An icon appears next
to the title, allowing you to quickly switch back and forth between perspectives in the same window. By default,
perspectives open in the same window.
If you use the plug-in configuration of Flash Builder and have other Eclipse plug-ins installed, you can have additional
perspectives. While predefined perspectives are delivered with each Eclipse plug-in, you can customize them or create
your own. To see a complete list of perspectives, select Window
> Open Perspective > Other.
The Flash Development perspective
The Flash Development perspective includes the editors and views you require to create applications for the Flex
framework. When you create a project, Flash Builder switches into the Development perspective so you can begin
developing your application.
The following example shows the Package Explorer, Outline, and Problems views:
7
The focal point of the perspective (and the workbench generally) is the editor area. The editor area contains all of the
currently open documents in a multitab interface.
When you create a Flex project, the main MXML application file is opened in the editor area. You can then open and
switch between any of the MXML, ActionScript, and CSS documents you are working in. For more information, see
“Flash Builder editors” on page 18.
Flash Development perspective in Source mode
In Source (code editing) mode, the Development perspective contains the editors and the following supporting views:
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
Package Explorer view
The Package Explorer view contains all of the projects and resources in the workspace and is therefore an essential
element of the Flash Builder workbench. It is always displayed in the Development and Debug perspectives.
8
When you work in the Package Explorer, you can select a resource and view its properties.
1 In the Package Explorer, select a resource.
2 Select File > Properties.
For more information about the Package Explorer and working with projects, see “Manage projects” on page 32.
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
Outline view
In Source mode, the Outline view presents a hierarchical view of the code structure of the selected MXML or
ActionScript document so that you can inspect and navigate the sections or lines of code in the document. The Outline
view also displays syntax error alerts that the compiler generates. This view is also available when you use the
ActionScript editor.
For more information about using the Outline view in Source mode, see “Use the Outline view” on page 73.
9
Problems view
As you enter code, the Flash Builder compiler detects syntax and other compilation errors, and these errors are
displayed in the Problems view. The Package Explorer marks nodes that contain errors.
When you debug your applications, errors, warnings, and other information are displayed in the Problems view. Each
error or warning contains a message, the file and folder in which it is located, and its line number in the file. Problems
remain in the Problems view until you correct them or they are otherwise resolved.
Note: You can also optionally add the Tasks and Bookmarks views. These views provide additional shortcuts for
managing and navigating your code. For more information about these views, see
“Use markers” on page 77. For an
introduction to the optional views that are available in Flash Builder, see “Other useful workbench views” on page 15.
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
ASDoc view
As you enter code, or hover over code elements, Flash Builder displays ASDoc content relevant to the code. Flash
Builder also displays the ASDoc content for the selected code in the ASDoc view.
For more information, see “Display ActionScript reference summary” on page 47.
10
Data/Services view
Flash Builder provides wizards and tools to connect to data services. Use the Data/Services view to connect to data
services. Once you connect to a data service, the Data/Services view displays the service, data types for returned data,
and available operations for the service. Use this view to configure access to the service and bind returned data to user
interface components.
For more information, see Building data-centric applications with Flash Builder.
Network Monitor view
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
The Network Monitor allows you to examine the data that flows between an application and the data service or
services. the Network Monitor is available with Flash Builder Premium.
For more information, see “Monitor applications that access data services” on page 207.
Flash Development perspective in Design mode
The Design mode of the MXML editor is the visual representation of the code that you edit in Source mode. In Design
mode, however, additional views are added to support design tasks. These views are the Components, Properties,
Appearance, States, and Design Mode Problems view.
11
In addition, when you are in Design mode, the Outline view displays the MXML structure of your applications. For
more information about designing applications in Flash Builder, see
“Build user interfaces” on page 167.
Note: Design mode is not available when working with ActionScript projects. To preview the user interface of your
ActionScript applications, build and run the applications. For more information about working with ActionScript, see
“ActionScript Projects” on page 31 and “Run and debug applications” on page 109.
In Design mode, the development perspective contains the MXML editor and the following views:
Components view
The Components view contains all of the standard Flex components, which you can select and add to the design area.
As you create your own custom components, they are also displayed in the Components view.
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
For more information, see “Create and edit Flash components” on page 228.
States view
Flex allows you to create applications that change their appearance based on events that are triggered directly by the
user or events that are generated programmatically. These user interface transformations are referred to as view states.
You create and manage view states in the States view.
For more information about view states, see “Add View states and transitions” on page 181.
Appearance view
The Appearance view allows you to set global application styles for text and colors. You can also specify the theme for
applications in the project.
12
Appearance panel
For more information, see “Apply styles to an application” on page 176.
Styles view
The Styles view allows you to set styles for specific components. The styles you can set vary, depending on the
component.
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
13
Style panel
For more information, see “Apply styles to an application” on page 176.
Flex Properties view
When a Flex component is selected, its properties are displayed in the Properties view. You can set and edit properties
as appropriate. You can view a component’s properties graphically (as shown in the following example) and as a
categorized or alphabetical list.
For more information, see “Set component properties” on page 24.
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
Outline view
In Design mode, the Outline view presents a hierarchical view of the MXML structure of your applications. You can
easily navigate the structure of an application by selecting individual MXML tag statements and components. When
you select an item in the Outline view, it is highlighted in Design mode.
14
For more information about working with the Outline view in Design mode, see “Inspect the structure of your MXML”
on page 27.
Design Mode Problems view
When the Design View initializes, if any problems are detected with the editor or project, the problems are displayed
in the Design Mode Problems view.
The Design Mode Problem Details panel displays the list of problems related to the initialized editor’s Design mode.
The problems are displayed in a tree structure format.
When you select a problem in the Design Mode Problem Details panel, details of the problem are displayed in the
Problem Details panel. When you close a project, the problems related to that project are removed from the Design
Mode Problems view.
Note: The Design Mode Problems view is displayed only when Design mode is enabled. If you disable Design mode
(Deselect Window
> Enable Design Mode), the Design Mode Problems view does not appear.
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
Other useful workbench views
In addition to the editors and views associated with Flash Builder’s default development, debugging, and profiling
perspectives, the workbench contains other views. These optional views are categorized by type and are associated with
distinct workbench functionality or with specific Eclipse plug-ins.
To access views that are not already displayed with a perspective and add them to the workbench, select Window >
Show View
These views include the Tasks, Bookmarks, and Search views that help you streamline the application development
process.
After you add a view to the current perspective, you can save that view as part of the perspective. For more information,
see
You can also create fast views to provide quick access to views that you use often. For more information, see “Create
and work with fast views” on page 17.
Bookmarks view
The Bookmarks view is used to manage the bookmarks that you add to specific lines of code or to resources. As in a
web browser, bookmarks are used as a convenience for tracking noteworthy items. Selecting a bookmark locates and
displays it in the workbench.
> Other.
“Customize a perspective” on page 16.
15
More Help topics
“Use markers” on page 77
Search view
The Search view is displayed automatically when you search the resources in the workspace. You can use it to define
and recall previous searches and to filter the list of search results.
More Help topics
“Search for resources in the workbench” on page 39
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
Work with perspectives
Set a default perspective
The word default in parentheses following the perspective name indicates the default perspective.
1 Open the Preferences dialog and select General > Perspectives.
2 Under Available Perspectives, select the perspective to define as the default, and click Make Default.
3 Click OK.
Open a perspective in a new window
You can specify to open perspectives in a new window.
1 Open the Preferences dialog and select General > Perspectives.
2 Under Open a New Perspective, select In A New Window.
To switch back to the default, select In The Same Window.
3 Click OK.
Customize a perspective
To modify a perspective’s layout, you change the editors and views that are visible in a given perspective. For example,
you could have the Bookmarks view visible in one perspective, and hidden in another perspective.
16
To create a perspective, do the following:
1 Open an existing perspective.
2 Show views and editors as desired.
3 Select Window > Perspective > Save Perspective As (Window > Save Perspective As in the plug-in configuration of
Flash Builder).
4 In the Save Perspective As dialog box, enter a new name for the perspective, then click OK.
To configure a perspective, do the following:
1 Open the perspective to configure.
2 Select Window > Customize Perspective.
3 Click the Shortcuts tab or the Commands tab, depending on the items you want to add to your customized
perspective.
4 Use the check boxes to select which elements to see on menus and toolbars in the selected perspective.
5 Click OK.
6 Select Window > Save Perspective As.
7 In the Save Perspective As dialog box, enter a new name for the perspective and click OK.
When you save a perspective, Flash Builder adds the name of the new perspective to the Window > Open
Perspective menu.
Delete a customized perspective
You can delete perspectives that were previously defined. You cannot delete a perspective you did not create.
1 Open the Preferences dialog and select General > Perspectives.
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
2 Under Available Perspectives, select the perspective you want to delete.
3 Click Delete, then click OK.
Reset a perspective
You can restore a perspective to its original layout after changing it.
1 Open the Preferences dialog and select General > Perspectives.
2 Under Available perspectives, select the perspective to reset.
3 Click Reset, then click OK.
Work with views
Move and dock views
You can move views to different locations in the workbench, docking or undocking them, as needed.
1 Drag the view by its title bar to the desired location.
As you move the view around the workbench, the pointer changes to a drop cursor. The drop cursor indicates
where you’ll dock the view when you release the mouse button.
17
You can drag a group of stacked views by dragging from the empty space to the right of the view tabs.
You can also move a view by using the view’s context menu. Open the context menu from the view’s tab, select
> View, move the view to the desired location, and click the mouse button again.
Move
2 (Optional) Save your changes by selecting Window > Save Perspective As.
Rearrange tabbed views
In addition to docking views at different locations in the workbench, you can rearrange the views in a tabbed group of
views.
❖ Click the tab of the view to move, drag the view to the desired location, and release the mouse button. A stack
symbol appears as you drag the view across other view tabs.
Switch between views
There are several ways to switch to a different view:
• Click the tab of a different view.
• Select a view from the Flash builder Window menu.
• Use a keyboard shortcut
Use Control+F7 on Windows, Command+F7 on Macintosh. Press F7 to select a view.
For a list of all keyboard shortcuts, go to Help > Key Assist
Create and work with fast views
Fast views are hidden views that you can quickly open and close. They work like other views, but do not take up space
in the workbench while you work.
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
Whenever you click the fast view icon in the shortcut bar, the view opens. Whenever you click anywhere outside the
fast view (or click Minimize in the fast view toolbar), the view becomes hidden again.
Note: If you convert the Package Explorer view to a fast view, and then open a file from the Package Explorer fast view,
the fast view automatically is hidden to allow you to work with that file.
To create a fast view, do the following:
❖ Drag the view you want to turn into a fast view to the shortcut bar located in the lower-left corner of the workbench
window.
The icon for the view that you dragged appears on the shortcut bar. You can open the view by clicking its icon on
the shortcut bar. As soon as you click outside the view, the view is hidden again.
To remove a fast view to normal view, do the following:
❖ From the view’s context menu, deselect Fast View.
Filter the Tasks and Problems views
You can filter the tasks or problems that are displayed in the Tasks or Problems views. For example, to see only
problems that the workbench has logged, or tasks that you logged as reminders to yourself, filter items according to
which resource or group of resources they are associated with. You can filter by text string in the Description field, by
problem severity, by task priority, or by task status.
18
1 In Tasks or Problems view taskbar, click Filter.
2 Complete the Filters dialog box and click OK.
For more information about views, see “Work with views” on page 17.
Flash Builder editors
When you develop applications in Flash Builder, you use the MXML, ActionScript 3.0, and CSS editors.
Editors are associated with resource types, and as you open resources in the workbench, the appropriate editor is
opened. Each editor provides the functionality required to author the given resource type.
MXML editor You use the MXML editor to edit MXML and to embed ActionScript and CSS code in <fx:Script> and
<fx:Style> tags. The MXML editor has two modes: Source and Design. Source mode is used for editing code. Design
mode is used for visually laying out and designing your applications. The two modes are synchronized and changes in
one mode are immediately reflected in the other.
ActionScript editor You use the ActionScript editor to edit ActionScript class and interface files. You can embed
ActionScript functions into an MXML file by using the
classes in separate ActionScript files and then import the classes into MXML files. Using this method, you can define
most of your applications in ActionScript.
CSS editor You use the CSS editor to display and edit Cascading Style Sheets. You can then apply styles to the visual
elements of your applications. For more information, see Styles and themes.
<fx:Script> tag. However, it is a common practice to define
Note: The CSS editor is a single-purpose editor for projects that use the Flex 4 SDK. However, for projects using the Flex
3 SDK, the CSS editor operates in two modes (Source and Design).
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
More Help topics
“Code Development Tools in Flash Builder” on page 44
Flash Builder Tips and Tricks
Use the MXML editor in Design mode
View an MXML file in Design mode
1 If the MXML file is not already open in the MXML editor, double-click the file in the Package Explorer to open it.
2 If the MXML editor displays source code, click Design at the top of the editor area.
You can quickly switch between modes by pressing Control+`(Left Quote).
Switching between Source and Design modes automatically shows or hides design-related views like the
Components, Properties, and States views. To turn this behavior on and off, from the Preferences dialog, select
Flex> Editors
Pan and scroll in the design area
❖ Click the Pan Mode button on the right side of the editor toolbar. Press H to enter Pan Mode from the keyboard.
To temporarily enter Pan Mode, press and hold the spacebar on the keyboard. You cannot select or move items in
Pan Mode.
> Design Mode, then select the Automatically Show Design-related Views option.
19
Zoom in the design area
There are several ways to use the zoom tool. You can select percentages from the main and pop-up menus, click the
Zoom Mode button in the toolbar, or use keyboard shortcuts. The current magnification percentage is always
displayed in the toolbar.
• From the main menu, select Design > Zoom In or Design > Zoom Out. You can also select the Magnification
submenu and choose a specific percentage.
• Click the Zoom Mode button in the toolbar or press Z from the keyboard. A plus symbol cursor appears in the
design area.
• Select a percentage from the pop-up menu next to the Select, Pan, and Zoom Mode buttons on the editor toolbar.
The design area changes to the selected percentage or fits to the window.
• Right-click in the design area to select Zoom In, Zoom Out, or the Magnification submenu. The design area
changes to your selection.
You can always use the following keyboard shortcuts from the design area:
• Zoom In: Ctrl+= (Command+= on Mac OS)
• Zoom Out: Ctrl+- (Command+- on Mac OS)
For more keyboard shortcuts, select Help > Key Assist.
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
Refresh Design mode to render properly
If necessary, you can refresh the MXML and CSS editors’ Design mode to render your layout properly. The rendering
of your layout can become out of date in certain situations. For example, if you modify a visual element in a dependent
Flash component (SWC). Styles and skins are not rendered properly sometimes because Flash Builder has to rebuild
the file.
❖ Click the Refresh button in the editor toolbar.
Work in both Source and Design modes simultaneously
You can create a split view so that you can work in both Source and Design modes simultaneously.
1 From the option menu on the editor’s tab, select New Editor.
You now have two editor tabs for the same file.
2 Drag one of the tabs to the right to position the editor windows side-by-side.
3 Set one of the editors to Design mode, and set the other editor to Source mode.
To work only in the Source mode disabling the Design mode, from the Window menu, deselect Enable Design Mode.
20
Work with components visually in MXML Design Mode
The MXML editor in Design mode lets you work with components visually so you can see what your application looks
like as you build it. You can view, select, pan, move, resize, scroll, and magnify items in the design area. Doing so is
especially useful when you have embedded container components.
Use the Components view
In Design mode of the MXML editor, Flash Builder displays the Components view, which you use to drag components
to the design area as you lay out your application.
By default, the Components view displays recommended components for a project. The version of the Flex SDK for a
project determines which components appear as recommended components.
For example, when creating a project, Flash Builder, by default, uses the Flex 4.6 SDK. Recommended components for
the Flex 4.6 SDK are Spark components. MX components that do not have an equivalent Spark component also appear
as recommended components.
The Components view groups components according to category, such as Controls, Layout, Navigators, and Charts.
There is also a Custom category that lists components defined in separate MXML and ActionScript files. For more
information, see
Note: The Components view lists visible components.
Modify how components appear in Components view
Use the View menu within the Components view to modify how components appear.
1 To show all components, deselect Only Show Recommended Components.
When you specify to show all components, Components view groups the components according to Spark and MX
components.
“Create custom MXML components” on page 215.
2 To show fully qualified class name, select Show Fully Qualified Class Names.
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
Add components in MXML Design mode
1 In the MXML editor’s Design mode, open the MXML file in which you want to insert the component.
An MXML file must be open in Design mode to use the Components view. The MXML file can be the main
application file (a file with an Application container) or a custom MXML component file.
2 In the Components view, locate the component that you want to add.
If the Components view is not open, select Window > Components.
21
Components view organizes components by category. The Components view also displays recommended
components for a project. You can change the view settings to list all components. For more information, see
“Components view” on page 11.
3 Drag a component from the Components view into the MXML file.
The component is positioned in the layout according to the layout rule of the parent container.
Select and move components in the design area
❖ Click the Select Mode (arrow) button on the right side of the editor toolbar. Select Mode is activated by default
when you open a document. Press V on the keyboard to enter Select Mode. Drag-and-drop a component to the
desired place. You can also drag to resize and click to select.
Select and deselect multiple components
You can select more than one component in an MXML file. Selecting multiple components can be useful if you want
to set a common value for a shared property.
• Control-click (Command-click on Macintosh) each component in the layout.
• Click the page background and draw a box that overlaps the components.
• In Outline view (Window > Outline), Control-click (Command-click on Macintosh) the components in the tree
control.
To deselect multiple components, do one of the following:
• Click the background container.
• Click a deselected component.
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
• Click in the gray margin around the root component.
Position components
You can change the position of components visually depending on the layout property of the parent container. If the
parent container specifies absolute positioning, you can drag-and-drop components to reposition them. Otherwise,
repositioned components follow the layout rules of the parent container.
By default, Spark containers use the BasicLayout property, which allows absolute positioning. For some MX
containers, you can also specify a layout property of
Note: You can also use layout constraints to position a component in a container. Layout constraints specify how to
reposition components when a container resizes. However, they can also be used to specify position in containers that have
a fixed size. See Using constraints to control component layout .
1 In the MXML editor’s Design mode, select the component in the layout and drag it to a new position.
The component is positioned in the layout according to the layout rules of the parent container.
If the container has absolute positioning, you can drag and position components anywhere in the container.
If you move a VGroup container in an HGroup container, the VGroup container is positioned into the horizontal
arrangement with the other child containers (if any).
absolute. For more information, see MX layout containers.
22
2 In Design mode, select the component’s parent container and edit the component’s layout properties in the
Properties View.
In some cases, you can change the position of child components by changing the properties of the parent container.
For example, you can use the
between child components and the
verticalGap and horizontalGap properties of a container to set the spacing
direction property to specify either a row or column layout.
Size components
You can change the size of a component in Design mode by dragging a resize handle, using the Design menu, or by
editing its properties in the Properties View.
Note: Use a constraint-based layout to specify how a component dynamically resizes when a container resizes. For more
information, see Using constraints to control component layout .
Size a component visually
❖ In the MXML editor’s Design mode, click the component and drag a resize handle to resize the component.
• To constrain the proportions of the component, hold down the Shift key while dragging.
• If snapping is enabled, as you resize, snap lines appear to line up the edges of the component with nearby
components. To enable or disable snapping from the main menu, select Design
Make two or more components the same width or height
1 In Design mode, select two or more components.
2 In the Design menu, select one of the following sizing options:
Make Same Width Sets the width property for all selected components to that of the component you selected first.
> Enable Snapping.
Make Same Height Sets the height property for all selected components to that of the component you selected
first.
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
If all selected components are in the same container, and the first component you select has a percent width or
height specified, all items are set to that percent width or height. Otherwise, all components are set to the same pixel
width or height.
Size a component by editing its properties
1 In Design mode, select the component.
You can Control-click (Shift-click on Mac OS) more than one component to set their sizes simultaneously.
2 In the Properties View (Window > Properties), set the height or width property of the selected component or
components.
The Properties View provides three views for inspecting a component’s properties: a standard form view, a
categorized table view, and an alphabetical table view. You can switch between them by clicking the view buttons
in the toolbar.
Use snapping to position components
When you drag a component visually in a container that has absolute positioning, the component can snap into place,
depending on where you drop it relative to existing components. The components can line up vertically or
horizontally.
By default, Spark containers use the BasicLayout property, which allows absolute positioning. For some MX
containers, you can also specify a layout property of
absolute. For more information, see MX layout containers.
23
You can disable snapping for one component or for all components.
Enable or disable snapping
❖ With the MXML file open in the MXML editor’s Design mode, select (or deselect) Design > Enable Snapping.
Enable or disable snapping as a preference
1 Open the Preferences dialog.
2 Select Flash Builder > Editors > Design Mode in the sidebar of the Preferences dialog box.
3 Select or deselect the Enable Snapping option.
Align components
You can visually align components relative to each other in a container that has absolute positioning. By default, Spark
containers use the BasicLayout property, which allows absolute positioning. For some MX containers, you can also
specify a layout property of
You can also center components in a container by using a constraint-based layout. For more information, see Using
constraints to control component layout .
Align components in a container that has absolute positioning
1 In the MXML editor’s Design mode, select two or more components in the container.
For more information, see “Select and deselect multiple components” on page 21.
2 Select one of the following alignment options from the Design menu:
Align Left Positions all selected components so that their left edges align with the edges of the first component that
you selected.
absolute.
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
Align Vertical Centers Positions all selected components so that their vertical center lines are aligned with the
vertical center line of the first component you selected.
Align Right Positions all selected components so that their right edges align with the edges of the first component
that you selected.
Align Top Positions all selected objects so that their top edges align with the edges of the first component you
selected.
Align Horizontal Centers Positions all selected components so their horizontal center lines are aligned with the
horizontal center line of the first component you selected.
Align Bottom Positions all selected components such that their bottom edges align with the edges of the first
component you selected.
Align Baselines Positions all selected components so that their horizontal text baselines are aligned with the text
baselines of the first component that you selected. For components that have no text baseline (such as HGroup),
the bottom edge is considered the baseline.
For objects with no layout constraints, Flash Builder adjusts the x property to change the vertical alignment, and
adjusts the
y property to change the horizontal alignment.
For objects with layout constraints, Flash Builder adjusts the left and right constraints to change the vertical
alignment and adjusts the top and bottom constraints to change the horizontal alignment. Only existing constraints
are modified; no new constraints are added.
24
For example, suppose component A has a left constraint and no right constraint, and component B has both a left
and right constraint. If you select component A and B and then select Design
> Align Vertical Centers, Flash
Builder adjusts the left constraint of object A and both the left and right constraints of object B to align them. The
unspecified right constraint of object A remains unspecified.
Nudge components
You can fine-tune the position of components in a container that has absolute positioning by adjusting the
components one pixel or ten pixels at a time in any direction with the arrow keys.
Nudge components by one pixel
❖ Select one or more components in the MXML editor’s Design mode and press an arrow key.
Nudge components by ten pixels
❖ Select one or more components in the MXML editor’s Design mode and press an arrow key while holding down
the Shift key.
Holding down the arrow key continues to move the component.
Hide container borders
By default, Flash Builder shows the borders of containers in the MXML editor’s Design mode. However, you can hide
these borders.
❖ Select Design > Show Container Borders.
This command is a toggle switch. Select it again to show the borders.
Set component properties
You visually set the properties of components in the design area or in the Properties view.
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
Edit the text displayed by a component
❖ To edit text displayed by a component such as a Label or TextInput control, double-click the component and enter
your edits.
Change text in the ID field
When you change text in the ID field, you are prompted to update all references in the workspace with the new ID.
You can suppress this dialog box on the Design Mode preferences page:
1 Open the Preferences window.
2 Select Flash Builder > Editors > Design Mode.
3 Select or deselect Always Update References When Changing IDs in the Properties View.
Set other properties of a component
❖ Select the component and set its properties in the Properties view (Window > Show View > Other > Flash Builder >
Properties).
25
Last updated 11/28/2011
USING FLASH BUILDER
Getting Started With Flash Builder
26
Properties view for a DataGrid component
To set the properties in Category view or Alphabetical view, click the view buttons in the toolbar:
Last updated 11/28/2011
Loading...
+ 225 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.