Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Creative tools for business
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / Flex Developer Center /

Five great new features in Flash Builder 4

by Andrew Shorten

Andrew Shorten

Created

17 August 2009

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
Flash Builder

Requirements

Prerequisite knowledge

Previous experience with Flex Builder is helpful but not necessary.

User level

All

Required products

  • Flash Builder 4 (Download trial)

I have already written about the major feature themes for Flash Builder 4 and provided an overview of each of these areas. In this article, I'll highlight five outstanding additions to the product, each of which were direct requests from the community - either via our public bug and enhancement system or via direction feedback when we meet with you at conferences and other events. We build the product for you and these features demonstrate that commitment.

Feature 1: Generation of accessor functions

Software development can be tedious. Many applications follow the same coding practices and patterns, and developers frequently spend lots of time on repetitive coding tasks—time that could otherwise be spent implementing more interesting logic. For Flash Builder 4, we targeted a number of these common coding tasks and delivered ways to get them done quickly.

The task that developers most often asked us to automate was the creation of accessor functions. Developers wanted a way to generate getter and setter methods, which comprise a public interface to access private class members. With Flash Builder 4, you can create these functions by simply placing your cursor on a class variable name and choosing Source > Generate Getter/Setter from either the main menu or the context menu. You can use the Generate Getter/Setter dialog box that opens to configure details about the accessor functions, and there’s even an option to preview the changes that Flash Builder 4 will make to your code (see Figure 1).

preview of the code generated by the new getter/setter feature
Figure 1. A preview of the code generated by the new getter/setter feature

Feature 2: Event code generation

Another common developer request is for generating event code. This feature is helpful both for experienced Flex developers looking to spend less time on tedious coding and for beginners unfamiliar with event-based development. For example, developers with a background in procedural web scripting technologies—like PHP or ColdFusion—may have never needed to implement an event listener to handle an event, such as a button being clicked. Flash Builder 4 can automatically generate the event handler functions for a UI object from the Flex Properties view, the context menu for an item in Design view, or with content assist for an item in Code view.

Each UI item, including buttons, lists, scrollbars, and so on, has a default event. A Button, for example, has the click event. If you select a button in Design view and right—click, you will see a context menu option Generate Click Handler. Likewise, the Property Inspector will show a field labeled “on click” and a button to generate the event. Of course, you can generate event handlers for all events of a UI item by expanding the Events node for the item in the Property Inspector. Once you generate an event handler, Flash Builder 4 generates a unique name for the event handler based on the object’s class name, properties, or a custom name you specify. The event handler is placed in the first script block of the file and you will be taken to that position in Code view. If you’re starting in Code view, you can also generate events for components. Place your cursor in a closed component tag and open content assist for the properties of the component by typing a space after the class name. The list of properties displayed includes events (for example, Click). Select an event and then select Generate Event Handler.

If you’re new to ActionScript and event—driven programming, the event code generation feature can help you learn the basics of connecting component events to methods. If you’re an experienced Flex developer, the feature can save you time by quickly generating stubs for all of your event functions.

Feature 3:Command—line builds

Many customers told us that as their Flex projects have grown in complexity, the need for Flex to fit into their enterprise development processes and systems has become more acute. One of the most common requests we heard from these customers was for a way to add Flex applications to nightly automated build processes. Unfortunately, previous versions made it difficult to synchronize a developer’s individual build settings with the nightly build. Flash Builder 4 solves this with the new <fb.ExportReleaseBuild> task and the <mxmlc> task, which you can use in custom scripts for nightly builds.

Command line builds can be used even if Flash Builder 4 is not installed on the nightly build machine. If Flash Builder 4 is present, the <fb.ExportReleaseBuild>task ensures that the nightly build’s settings exactly match the settings used by developers during their daily work. It also allows you to automate some of the common tasks included in a Flash Builder 4 build, for example automatically compiling associated library projects and copying assets such as JPEGs into the output directory. If Flash Builder 4 is not installed on the build machine, you can write a custom script, such as an Ant script, that uses the <mxmlc> task, but the build machine must have the Flex SDK available. You will also need to keep two sets of build settings to synchronize. One set is kept in Flash Builder 4 and used by developers during their daily work, the other set is maintained on your nightly build machine. Consult the Adobe Flex 4 Features and Migration Guide for more details about how to use both approaches.

Feature 4: Debugger enhancements

Having a full featured debugger is one of the great benefits of an integrated development environment. Flex Builder 3 has excellent debugging capabilities, but there were still many additional features and enhancements for which you’ve been asking. So for Flash Builder 4, we’ve invested heavily in taking the debugger to the next level.

Sometimes, you may need to stop the debugger from executing when specific conditions are met. With Flash Builder 4, you can use expressions to define these conditional breakpoints to halt execution when the expression evaluates to true, when the value of the expression changes, or when a specified hit count has been reached. Evaluation of watch expressions has also been enhanced in this release. You can use the Expressions view to watch variables you selected in the Variables view, as well as to add and evaluate watch expressions while debugging your applications.

When debugging an application, you may want to know when specific instances of variables change value. Flash Builder 4 allows this with a new feature called watchpoints. You set a watchpoint on a specific instance of a variable from the Variables view during a debugging session, and execution will be halted when the watched variable changes value.

Finally, if you have ever set a debugger breakpoint within a loop that repeats many times, you’ll appreciate the new run—to—line command, which can be used to break out of a loop during a debugging session.

Feature 5: Network Monitor

Nearly all Flex applications exchange data with a server or service of some sort. The requests and responses move back and forth between the client and server in different formats depending on the technique that you use as a developer. In Flex 3 you have little insight into what’s happening as the exchange occurs, no matter what technique you use. You can debug your Flex application and see what remote call is made, but then you have to wait and see what (if anything) comes back from the server. Likewise, you can debug your server—side logic, but it’s difficult to know what happens to the data once you send it back to Flex. Monitoring the actual network traffic—the requests and response data—has not been possible with Flex Builder.

Flash Builder 4 introduces the Network Monitor, a tool that you can use to examine the SOAP, AMF, Remote Object, XML, and HTTP traffic that flows between your Flex application and its data service or services. Now you have a simple view, that provides extensive monitoring and debugging information to make building data—centric applications much easier.

To begin, click the Enable Network Monitor icon on the Network Monitor toolbar and then run the either the development or debug version of the application as you would normally. As you interact with your application, the Network Monitor captures and stores all calls to remote services in chronological order. At any time, you can switch back to the Network Monitor view to see the results of each call. The results from calls to each remote service are presented in a table listing the time of the request, the requesting service, the operation and URL (if applicable), the time of the response, and the elapsed time. You can also examine the response, including the actual data sent back. You can analyze this information as the application is running, or you can click the Save icon to write all captured information to an XML file for later analysis.

Where to go from here

Whether you are a new or experienced Flex developer, Flash Builder 4 has a feature that will make development easier for you. Be sure to take advantage of the other great content that we’ve created to support this release.

If you are new to Flex development and would like to get started with Flash Builder 4 then I'd recommend the learning videos and tutorials that can be accessed from the Start Page within the product - available to you when you first start Flash Builder or from the Help > Flash Builder Start Page menu item.


This work is licensed under a Creative Commons Attribution-Noncommercial 3.0 Unported License.

Tutorials & Samples

Tutorials

  • Flex mobile performance checklist
  • Flex and Maven with Flexmojos – Part 3: Journeyman
  • Migrating Flex 3 applications to Flex 4.5 – Part 4

Samples

  • Twitter Trends
  • Flex 4.5 reference applications
  • Mobile Trader Flex app on Android Market

Flex User Forum

More
07/25/2011 Flash Player Debug Issues - Safari 5.1 & Chrome 13
04/22/2012 Loader png - wrong color values in BitmapData
04/22/2012 HTTPService and crossdomain.xml doesn't work as expected
04/23/2012 Memory related crashes in Flex application

Flex Cookbook

More
04/06/2012 How to detect screen resize with a SkinnableComponent
02/29/2012 Embed Stage3D content inside Flex application components
02/15/2012 Custom WorkFlow Component
02/09/2012 Using Camera with a MediaContainer instead of VideoDisplay

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement