Flash® Builder™ 4 and Flex® 4 Bible

Book description

A complete and thorough reference for developers on the new Flex 4 platform

Create desktop applications that behave identically on Windows, Mac OS X, and Linux with Adobe's new Flash Builder 4 platform and this in-depth guide. The book's tutorials and explanations walk you step-by-step through Flash Builder's new, faster tools; the new framework for generating code; how to connect to popular application servers; upgrading from Flex 3; and much more.

  • Shows you how to create rich applications for the Web and desktop with the very latest version of Flex, with detailed coverage for both new and veteran Flex application developers

  • Walks you through Flex basics; upgrading from Flex 3; how to create desktop applications with AIR; and integrating Flex applications with the most popular application servers, including ColdFusion, ASP.NET, and PHP

  • Includes extensive code samples of common tasks that you can use to jump-start your development projects

Flex your development muscles with the Flex 4 and this comprehensive guide.

Table of contents

  1. Copyright
  2. About the Author
  3. Credits
  4. Preface
    1. Getting the Most Out of This Book
    2. Using the Book's Icons
  5. Acknowledgments
  6. I. Flex Fundamentals
    1. 1. About Flex 4
      1. 1.1. Learning the Fundamentals of Flex
        1. 1.1.1. Getting to know Flex applications
          1. 1.1.1.1. Flex programming languages
          2. 1.1.1.2. MXML versus ActionScript 3
          3. 1.1.1.3. Declaring objects in MXML
          4. 1.1.1.4. Declaring objects in ActionScript 3
        2. 1.1.2. Flex versus Flash development
          1. 1.1.2.1. Developing in Flash
          2. 1.1.2.2. Developing in Flex
        3. 1.1.3. Flex and object-oriented programming
          1. 1.1.3.1. Modularity
          2. 1.1.3.2. Encapsulation
          3. 1.1.3.3. Inheritance
          4. 1.1.3.4. Polymorphism
      2. 1.2. Understanding Adobe Flash Player
        1. 1.2.1. Learning a little Adobe Flash Player history
        2. 1.2.2. Understanding Flash Player penetration statistics
        3. 1.2.3. Using the debug version of Flash Player
        4. 1.2.4. Flash Player installation
          1. 1.2.4.1. Uninstalling Flash Player
          2. 1.2.4.2. Installation with Flash Builder
          3. 1.2.4.3. Using Flash Builder installation files
          4. 1.2.4.4. Installing Flash Player from the Web
          5. 1.2.4.5. Downloading the production Flash Player
          6. 1.2.4.6. Downloading the debug version of Flash Player
      3. 1.3. Flex 4 Development Tools
        1. 1.3.1. Understanding Flash Builder 4
        2. 1.3.2. Using the Flex 4 SDK
          1. 1.3.2.1. Using MXMLC, the command-line compiler
      4. 1.4. Getting Help
      5. 1.5. Summary
    2. 2. Using Flash Builder 4
      1. 2.1. Getting Flash Builder
      2. 2.2. Installing Flash Builder 4
        1. 2.2.1. Installing Flash Builder with the stand-alone configuration
          1. 2.2.1.1. Running the stand-alone installer
          2. 2.2.1.2. Getting Eclipse
          3. 2.2.1.3. Preparing to install Eclipse
          4. 2.2.1.4. Selecting an Eclipse distribution
          5. 2.2.1.5. Installing Eclipse
          6. 2.2.1.6. Eclipse on Windows
          7. 2.2.1.7. Eclipse on Mac OS X
          8. 2.2.1.8. Installing the Flash Builder plug-in
      3. 2.3. Getting to Know Eclipse Features
        1. 2.3.1. The Eclipse workspace
          1. 2.3.1.1. Eclipse projects
          2. 2.3.1.2. Eclipse views
          3. 2.3.1.3. Eclipse editors
          4. 2.3.1.4. Eclipse perspectives
        2. 2.3.2. Configuring Eclipse
          1. 2.3.2.1. Changing fonts
          2. 2.3.2.2. Selecting a Web browser
      4. 2.4. Using Flash Builder
        1. 2.4.1. Creating a Flex project
        2. 2.4.2. Understanding Flash Builder's user interface
          1. 2.4.2.1. The MXML editor
          2. 2.4.2.2. The ActionScript editor
          3. 2.4.2.3. Flash Builder views
          4. 2.4.2.4. Package Explorer view
          5. 2.4.2.5. Outline view
          6. 2.4.2.6. Problems view
          7. 2.4.2.7. Design views
          8. 2.4.2.8. Debugging views
      5. 2.5. Getting Help
        1. 2.5.1. Exploring the Help contents
        2. 2.5.2. Searching for Help terms
        3. 2.5.3. Using dynamic help
      6. 2.6. Searching for Code
        1. 2.6.1. Using Eclipse search tools
          1. 2.6.1.1. Using Find/Replace
          2. 2.6.1.2. Using Find in Files
        2. 2.6.2. Using Flash Builder code model search tools
          1. 2.6.2.1. Searching for references
          2. 2.6.2.2. Searching for a declaration
          3. 2.6.2.3. Refactoring variable names
          4. 2.6.2.4. Refactoring source-code files
          5. 2.6.2.5. Moving existing source-code files
      7. 2.7. Generating Code
        1. 2.7.1. Generating getter and setter methods
        2. 2.7.2. Generating event handlers
      8. 2.8. Integrating Flash Builder with Flash Professional CS5
      9. 2.9. Summary
    3. 3. Building a Basic Flex Application
      1. 3.1. Creating a "Hello World" Application
        1. 3.1.1. Switching workspaces
        2. 3.1.2. Creating the project
        3. 3.1.3. Saying hello
      2. 3.2. Understanding the html-template Folder
        1. 3.2.1. The HTML wrapper template
          1. 3.2.1.1. The HTML <head> section
          2. 3.2.1.2. Running the application
          3. 3.2.1.3. Using the flashvars parameter
          4. 3.2.1.4. The HTML <noscript> section
        2. 3.2.2. History management files
      3. 3.3. Deploying the Application
        1. 3.3.1. Creating a release build
        2. 3.3.2. Testing the release build
        3. 3.3.3. Deploying the release build
        4. 3.3.4. Integrating an application into an existing Web page
        5. 3.3.5. Integrating Flex applications with Dreamweaver
      4. 3.4. Summary
    4. 4. Understanding the Anatomy of a Flex Application
      1. 4.1. MXML and ActionScript 3
      2. 4.2. Understanding MXML
        1. 4.2.1. MXML is XML!
          1. 4.2.1.1. Using XML as a programming language
          2. 4.2.1.2. XML namespaces
          3. 4.2.1.3. XML namespace prefixes
          4. 4.2.1.4. Understanding MXML manifests
          5. 4.2.1.5. Using XML child elements
          6. 4.2.1.6. Using CDATA blocks
          7. 4.2.1.7. XML entities
        2. 4.2.2. MXML and containership
        3. 4.2.3. MXML and nonvisual classes
      3. 4.3. Understanding ActionScript 3
        1. 4.3.1. ActionScript syntax
        2. 4.3.2. Declaring variables
          1. 4.3.2.1. Using access modifiers
          2. 4.3.2.2. Declaring variables within functions
          3. 4.3.2.3. Initializing variable values
          4. 4.3.2.4. Using ActionScript operators
        3. 4.3.3. Conditional statements
        4. 4.3.4. Looping
      4. 4.4. Combining MXML and ActionScript
        1. 4.4.1. Using the <fx:Script> element
        2. 4.4.2. Using external ActionScript files
        3. 4.4.3. Managing ActionScript code with Flash Builder
          1. 4.4.3.1. Using the Outline view with ActionScript
          2. 4.4.3.2. Managing code in the ActionScript editor
      5. 4.5. Using the Application Component
        1. 4.5.1. Passing application parameters
        2. 4.5.2. Controlling application dimensions
        3. 4.5.3. Setting the layout property
          1. 4.5.3.1. Vertical and horizontal layout
          2. 4.5.3.2. Basic layout
      6. 4.6. Summary
    5. 5. Using Bindings and Components
      1. 5.1. Using Binding Expressions
        1. 5.1.1. Shorthand MXML binding expressions
        2. 5.1.2. Using <fx:Binding>
        3. 5.1.3. Making expressions bindable
      2. 5.2. Using MXML Components
        1. 5.2.1. Creating MXML components
          1. 5.2.1.1. Component inheritance
          2. 5.2.1.2. Creating a new MXML Component
        2. 5.2.2. Instantiating MXML components
          1. 5.2.2.1. Instantiating a component with MXML
          2. 5.2.2.2. Inserting a custom component instance in Design mode
          3. 5.2.2.3. Instantiating a component with ActionScript
      3. 5.3. Adding Properties and Methods to Components
        1. 5.3.1. Component properties
          1. 5.3.1.1. Setting properties
          2. 5.3.1.2. Static properties
          3. 5.3.1.3. Making a property bindable
          4. 5.3.1.4. Declaring public properties with MXML tags
          5. 5.3.1.5. Passing data to a component property
          6. 5.3.1.6. Using constants
        2. 5.3.2. Component methods
          1. 5.3.2.1. Defining methods
          2. 5.3.2.2. Calling component methods
      4. 5.4. Using Component Libraries
        1. 5.4.1. Creating component libraries
          1. 5.4.1.1. Creating a library project
          2. 5.4.1.2. Creating a project's folder structure
        2. 5.4.2. Using component libraries
          1. 5.4.2.1. Adding a component library to a project's build path
          2. 5.4.2.2. Using the libs folder
      5. 5.5. Creating Flash-based Components
      6. 5.6. Summary
    6. 6. Debugging Flex Applications
      1. 6.1. Debugging Basics
        1. 6.1.1. The debug version of the application
        2. 6.1.2. Running an application in debug mode
          1. 6.1.2.1. Managing the Console view
          2. 6.1.2.2. Terminating a debugging session
      2. 6.2. Using trace() and the Logging API
        1. 6.2.1. Using the trace() function
          1. 6.2.1.1. Trace messages in Flash Builder's Console view
          2. 6.2.1.2. Sending tracing messages to flashlog.txt
        2. 6.2.2. Using the Logging API
          1. 6.2.2.1. Using the Log class
          2. 6.2.2.2. Using Logger objects
          3. 6.2.2.3. Self-logging components
          4. 6.2.2.4. Using tracing targets
      3. 6.3. Using Breakpoints
        1. 6.3.1. Setting and clearing breakpoints
        2. 6.3.2. Setting and removing breakpoints in an MXML or ActionScript editor
        3. 6.3.3. Setting conditional breakpoints
        4. 6.3.4. Using the Breakpoints view
          1. 6.3.4.1. Exporting breakpoints to an external file
          2. 6.3.4.2. Importing breakpoints from an external breakpoint file
        5. 6.3.5. Using breakpoints in a debugging session
        6. 6.3.6. Inspecting variables and expressions
          1. 6.3.6.1. Using the Variables view
          2. 6.3.6.2. Setting watchpoints
          3. 6.3.6.3. Using the Expressions view
          4. 6.3.6.4. Adding an expression
        7. 6.3.7. Controlling application execution with the Debug view
      4. 6.4. Profiling Flex Applications
      5. 6.5. Using the Network Monitor
        1. 6.5.1. Configuring a Flex project for use with ColdFusion
          1. 6.5.1.1. Configuring a Flex project to use ColdFusion
          2. 6.5.1.2. Testing the Flex applications
        2. 6.5.2. Tracing network traffic
          1. 6.5.2.1. Enabling the Network Monitor
          2. 6.5.2.2. Tracing HTTPRequest data
          3. 6.5.2.3. Tracing WebService data
          4. 6.5.2.4. Tracing RemoteObject data
      6. 6.6. Summary
    7. 7. Working with Events
      1. 7.1. The Flex Event Architecture
      2. 7.2. Handling Events in MXML
        1. 7.2.1. Declaring event listeners in MXML
          1. 7.2.1.1. Executing a single ActionScript statement in an event handler
          2. 7.2.1.2. A simple event handling application
          3. 7.2.1.3. Handling events with ActionScript functions
          4. 7.2.1.4. Using an event handler function
        2. 7.2.2. Working with event objects
          1. 7.2.2.1. The event object's variable name
          2. 7.2.2.2. Using event object arguments
          3. 7.2.2.3. Generating an event handler function
          4. 7.2.2.4. Using event object properties
          5. 7.2.2.5. Using event object properties in an application
          6. 7.2.2.6. Event class inheritance
          7. 7.2.2.7. Which event class will I get?
          8. 7.2.2.8. Debugging the event object
          9. 7.2.2.9. Reading the documentation
          10. 7.2.2.10. Handling specific event objects
      3. 7.3. Handling Events with addEventListener()
        1. 7.3.1. Setting up an event listener
        2. 7.3.2. Using event name constants
        3. 7.3.3. Removing an event listener
      4. 7.4. Using Event Bubbling
      5. 7.5. Using Custom Events
        1. 7.5.1. Declaring custom events
          1. 7.5.1.1. Adding an event declaration to a custom component and testing it
        2. 7.5.2. Dispatching custom events
        3. 7.5.3. Handling custom events
          1. 7.5.3.1. Handling a custom event with MXML
      6. 7.6. Using Custom Event Classes
        1. 7.6.1. Creating the ActionScript class
          1. 7.6.1.1. Using the New ActionScript Class wizard
          2. 7.6.1.2. Declaring public properties
          3. 7.6.1.3. Declaring event name constants
          4. 7.6.1.4. Overriding the clone() method
        2. 7.6.2. Dispatching a custom event class
        3. 7.6.3. Handling an event that uses a custom event class
      7. 7.7. Summary
  7. II. Designing Flex Applications
    1. 8. Using Flex Visual Controls
      1. 8.1. Instantiating and Customizing Controls
        1. 8.1.1. Instantiating controls with MXML and ActionScript
        2. 8.1.2. Setting control properties and styles
        3. 8.1.3. Understanding UIComponent and GraphicElement
      2. 8.2. Using Spark Text Controls
        1. 8.2.1. Using text control properties
          1. 8.2.1.1. Using the text property
          2. 8.2.1.2. Using the content property
          3. 8.2.1.3. Managing rich text display with the TextFlow class
          4. 8.2.1.4. Looking at the TextFlowUtil class
          5. 8.2.1.5. Using the whiteSpaceCollapse style
        2. 8.2.2. Text entry controls
          1. 8.2.2.1. The TextInput control
          2. 8.2.2.2. The TextArea control
      3. 8.3. Using Layout Controls
        1. 8.3.1. The HRule and VRule controls
        2. 8.3.2. The Spacer control
      4. 8.4. Using Button Controls
        1. 8.4.1. The Button control
        2. 8.4.2. The LinkButton control
        3. 8.4.3. The CheckBox control
        4. 8.4.4. The RadioButton controls
      5. 8.5. Other Data Entry Controls
        1. 8.5.1. The NumericStepper control
        2. 8.5.2. Date controls
          1. 8.5.2.1. The DateChooser control
          2. 8.5.2.2. The DateField control
          3. 8.5.2.3. Date entry properties and methods
        3. 8.5.3. The ColorPicker control
      6. 8.6. Using Interactive Controls
        1. 8.6.1. The ScrollBar controls
          1. 8.6.1.1. ScrollBar properties
          2. 8.6.1.2. The change event
        2. 8.6.2. The Slider controls
          1. 8.6.2.1. Slider properties
          2. 8.6.2.2. Slider events
      7. 8.7. Using the Image and BitmapImage Controls
        1. 8.7.1. Resizing images
        2. 8.7.2. Embedding images
        3. 8.7.3. Changing images at runtime
      8. 8.8. Summary
    2. 9. Working with Text
      1. 9.1. Using Advanced Text Layout
        1. 9.1.1. Presenting richly formatted text
        2. 9.1.2. Presenting text in columns
        3. 9.1.3. Using bidirectional text
      2. 9.2. Controlling Fonts with Cascading Style Sheets
        1. 9.2.1. Selecting fonts
        2. 9.2.2. Using device fonts
        3. 9.2.3. Using embedded fonts
          1. 9.2.3.1. Declaring embedded fonts with CSS
          2. 9.2.3.2. Embedding ranges of characters in CSS
          3. 9.2.3.3. Declaring embedded fonts with ActionScript
      3. 9.3. Manipulating Text
      4. 9.4. Formatting Text Values
        1. 9.4.1. Creating formatter objects
        2. 9.4.2. Setting formatter properties
        3. 9.4.3. Using formatters in binding expressions
        4. 9.4.4. Using formatters in static methods
      5. 9.5. Summary
    3. 10. Using Layout Containers
      1. 10.1. Using MX Basic Containers
        1. 10.1.1. Using vertical and horizontal layout containers
          1. 10.1.1.1. The VBox container
          2. 10.1.1.2. The HBox container
        2. 10.1.2. Using the Canvas container
        3. 10.1.3. Using MX container styles
      2. 10.2. Using Spark Group Components
        1. 10.2.1. Using the Group component
        2. 10.2.2. Using VGroup and HGroup
        3. 10.2.3. Using the Spark BorderContainer
      3. 10.3. Using Panel Containers
        1. 10.3.1. Panel properties
          1. 10.3.1.1. Using the layout property
          2. 10.3.1.2. Using the title and status properties
        2. 10.3.2. Using the MX ControlBar container
        3. 10.3.3. Using Spark panels with control bars
      4. 10.4. Using Constraint-Based Layout
        1. 10.4.1. Positioning components in Design mode
        2. 10.4.2. Using constraint properties
      5. 10.5. Sizing Containers and Controls
        1. 10.5.1. Content-based sizing
          1. 10.5.1.1. Default dimensions
          2. 10.5.1.2. Minimum and maximum dimensions
        2. 10.5.2. Absolute sizing
        3. 10.5.3. Percentage sizing
          1. 10.5.3.1. Percentage sizing with height and width
          2. 10.5.3.2. Percentage sizing with percentHeight and percentWidth
          3. 10.5.3.3. Using percentage ratios
        4. 10.5.4. Constraint-based sizing
      6. 10.6. Creating a Scrolling Region
      7. 10.7. Summary
    4. 11. Using Cascading Style Sheets
      1. 11.1. About Cascading Style Sheets
      2. 11.2. What Is a Style Sheet?
      3. 11.3. Using Inline Style Declarations
      4. 11.4. Declaring Style Sheets with <fx:Style>
      5. 11.5. Using Style Selectors
        1. 11.5.1. Using type selectors
          1. 11.5.1.1. Understanding CSS namespaces
          2. 11.5.1.2. Using multiple type selectors
          3. 11.5.1.3. Applying type selectors to custom components
          4. 11.5.1.4. Looking at type selectors and class inheritance
        2. 11.5.2. Using descendant selectors
        3. 11.5.3. Using style name selectors
        4. 11.5.4. Using ID selectors
        5. 11.5.5. Using the global selector
      6. 11.6. Using Embedded Style Sheets
      7. 11.7. Using External Style Sheets
        1. 11.7.1. Creating a blank style sheet
        2. 11.7.2. Exporting existing styles
      8. 11.8. Using Compiled Style Sheets
        1. 11.8.1. Compiling style sheets
        2. 11.8.2. Loading compiled style sheets
      9. 11.9. Controlling Styles with ActionScript
        1. 11.9.1. Setting and getting style information
        2. 11.9.2. Modifying style selectors at runtime
          1. 11.9.2.1. Using bound CSS declarations
          2. 11.9.2.2. Binding CSS declarations with the styleManager object
      10. 11.10. Summary
    5. 12. Controlling Animation and Working with Drag and Drop
      1. 12.1. Using Effects
        1. 12.1.1. Declaring and playing effect classes
        2. 12.1.2. Declaring effects in ActionScript
        3. 12.1.3. Using the new Spark effects
          1. 12.1.3.1. Using the Animate effect
          2. 12.1.3.2. Using the Fade effect
          3. 12.1.3.3. Using the Move and Move3D effects
          4. 12.1.3.4. Using the Rotate and Rotate3D effects
        4. 12.1.4. Using composite effects
          1. 12.1.4.1. Using Parallel effects
          2. 12.1.4.2. Using Sequence effects
        5. 12.1.5. Using easing classes
      2. 12.2. Using Drag-and-Drop Operations
        1. 12.2.1. Implementing drag-and-drop with List controls
        2. 12.2.2. Implementing custom drag-and-drop operations
          1. 12.2.2.1. Initiating a drag-and-drop operation
          2. 12.2.2.2. Creating a proxy image
          3. 12.2.2.3. Handling the dragEnter event
          4. 12.2.2.4. Handling the dragDrop event
      3. 12.3. Summary
    6. 13. Managing View States
      1. 13.1. Understanding View States
      2. 13.2. Defining View States in Design View
        1. 13.2.1. Creating a new state
        2. 13.2.2. Defining a view state's overrides
      3. 13.3. Switching View States at Runtime
      4. 13.4. Declaring View States in MXML
        1. 13.4.1. Adding and removing components
        2. 13.4.2. Overriding properties, styles, and event handlers
      5. 13.5. Managing View States in Components
      6. 13.6. Using Transitions
        1. 13.6.1. Declaring a transition
        2. 13.6.2. Using Parallel and Sequence effects in transitions
          1. 13.6.2.1. Using the Parallel effect in a transition
          2. 13.6.2.2. Using the Sequence effect in a transition
      7. 13.7. Summary
    7. 14. Declaring Graphics with MXML and FXG
      1. 14.1. Declaring Vector Graphics in MXML
        1. 14.1.1. Drawing lines and shapes
          1. 14.1.1.1. Drawing lines
          2. 14.1.1.2. Using gradient strokes
          3. 14.1.1.3. Drawing rectangular and elliptical shapes
          4. 14.1.1.4. Drawing arbitrary shapes with the Path class
        2. 14.1.2. Adding visual effects
          1. 14.1.2.1. Using gradient fills
          2. 14.1.2.2. Reusing graphic elements with <fx:Library> and <fx:Definition>
          3. 14.1.2.3. Scaling graphic elements
          4. 14.1.2.4. Applying filters
      2. 14.2. Using FXG Files
        1. 14.2.1. Creating FXG graphics with Creative Suite software
          1. 14.2.1.1. Creating FXG graphics with Photoshop
          2. 14.2.1.2. Creating FXG graphics with Illustrator
          3. 14.2.1.3. Creating FXG graphics with Fireworks
        2. 14.2.2. Using FXG files in Flex applications
          1. 14.2.2.1. Embedding FXG graphics with <s:BitmapImage>
          2. 14.2.2.2. Using FXG files as ActionScript classes
      3. 14.3. Summary
    8. 15. Skinning Spark Components
      1. 15.1. Creating and Using Spark Custom Skins
        1. 15.1.1. Skinning a Spark application
          1. 15.1.1.1. Creating a custom skin
          2. 15.1.1.2. Associating the skin with the host component
          3. 15.1.1.3. Declaring required skin states
          4. 15.1.1.4. Adding required skin parts
          5. 15.1.1.5. Adding vector graphics to the skin
        2. 15.1.2. Binding a custom skin to a Spark component
          1. 15.1.2.1. Assigning a skin for a single component
          2. 15.1.2.2. Setting a custom skin with a style sheet declaration
          3. 15.1.2.3. Loading custom skins at runtime
      2. 15.2. Skinning Other Spark Components
        1. 15.2.1. Creating a new skin
        2. 15.2.2. Assigning custom skins with CSS
        3. 15.2.3. Customizing the skin
      3. 15.3. Summary
    9. 16. Managing Application Navigation
      1. 16.1. Understanding Classic Web Navigation
      2. 16.2. Understanding Flex Navigation
      3. 16.3. Using Navigator Containers
        1. 16.3.1. Declaring a ViewStack in MXML
        2. 16.3.2. Using custom components in a navigator container
        3. 16.3.3. Creating a ViewStack in Design mode
        4. 16.3.4. Working with navigator containers in ActionScript
          1. 16.3.4.1. Using selectedIndex
          2. 16.3.4.2. Using numChildren
          3. 16.3.4.3. Navigating forward and backward through view stack layers
          4. 16.3.4.4. Managing binding issues
          5. 16.3.4.5. Using selectedChild
        5. 16.3.5. Managing creation policy
        6. 16.3.6. Managing navigator container dimensions
      4. 16.4. Using Navigator Bar Containers
        1. 16.4.1. Using a data collection as a dataProvider
        2. 16.4.2. Handling navigator bar events
        3. 16.4.3. Using a ViewStack as a dataProvider
        4. 16.4.4. Managing navigator bar presentation
      5. 16.5. Using Menu Controls
        1. 16.5.1. Menu data providers
        2. 16.5.2. Handling menu events
        3. 16.5.3. Using the Menu control
        4. 16.5.4. Using the MenuBar control
      6. 16.6. Using Other Navigator Containers
        1. 16.6.1. The TabNavigator container
        2. 16.6.2. The Accordion container
        3. 16.6.3. TabNavigator and Accordion keyboard shortcuts
      7. 16.7. Summary
    10. 17. Working with Pop-up Windows
      1. 17.1. Using the Alert Class
        1. 17.1.1. Presenting pop-up windows with Alert.show()
        2. 17.1.2. Controlling Alert window modality
        3. 17.1.3. Managing Alert window buttons
          1. 17.1.3.1. Non-modal dialog boxes with multiple buttons
          2. 17.1.3.2. Setting button labels
          3. 17.1.3.3. Setting a default button
        4. 17.1.4. Handling Alert window events
        5. 17.1.5. Using a custom graphical icon
        6. 17.1.6. Using CSS selectors with the Alert class
      2. 17.2. Using the PopUpMenuButton Control
        1. 17.2.1. Creating a data provider
        2. 17.2.2. Handling events
      3. 17.3. Using the PopUpButton control
        1. 17.3.1. Declaring the pop-up window
        2. 17.3.2. Handling events and managing pop-up behavior
      4. 17.4. Working with Custom Pop-up Windows
        1. 17.4.1. Defining a custom pop-up window
          1. 17.4.1.1. Creating the component
          2. 17.4.1.2. Sharing data with event
        2. 17.4.2. Managing custom pop-up windows with the PopUpManager class
          1. 17.4.2.1. Adding a pop-up window to the display
          2. 17.4.2.2. Removing a pop-up window
      5. 17.5. Summary
  8. III. Working with Data
    1. 18. Modeling and Managing Data
      1. 18.1. Creating a Data Model
        1. 18.1.1. Using the <fx:Model> element
          1. 18.1.1.1. Benefits of <fx:Model>
          2. 18.1.1.2. Drawbacks of <fx:Model>
          3. 18.1.1.3. Importing data with <fx:Model>
      2. 18.2. Using Value Objects
        1. 18.2.1. Using the New ActionScript Class wizard
        2. 18.2.2. Value object class syntax
          1. 18.2.2.1. Declaring a package
          2. 18.2.2.2. Declaring the public class
          3. 18.2.2.3. Declaring ActionScript class properties
        3. 18.2.3. Instantiating value object classes
          1. 18.2.3.1. Instantiating with MXML
          2. 18.2.3.2. Setting object properties in MXML
          3. 18.2.3.3. Instantiating value objects with ActionScript
      3. 18.3. Using Data Collections
        1. 18.3.1. Declaring an ArrayCollection
        2. 18.3.2. Setting a data collection object's source property
        3. 18.3.3. Accessing data at runtime
        4. 18.3.4. Managing data at runtime
          1. 18.3.4.1. Filtering data
          2. 18.3.4.2. Sorting data
        5. 18.3.5. Using data cursors
          1. 18.3.5.1. Traversing data
          2. 18.3.5.2. Finding data with a cursor
          3. 18.3.5.3. Bookmarking data
      4. 18.4. Summary
    2. 19. Using List Controls
      1. 19.1. Using Data Providers
        1. 19.1.1. Using hard-coded data providers
          1. 19.1.1.1. Nesting hard-coded data in a data provider
          2. 19.1.1.2. Modifying data with the ArrayList API
          3. 19.1.1.3. Declaring separate data objects with MXML tags
        2. 19.1.2. Using dynamic data providers
          1. 19.1.2.1. Using RPC components
          2. 19.1.2.2. Retrieving local data in AIR applications
      2. 19.2. Controlling List Item Labels
        1. 19.2.1. Using the labelField property
        2. 19.2.2. Using the labelFunction property
      3. 19.3. List Control Events and Properties
      4. 19.4. Handling User Data Selections
        1. 19.4.1. Using the change event
        2. 19.4.2. Using the selectedItem property
        3. 19.4.3. Using the selectedIndex property
        4. 19.4.4. Selecting complex data objects
      5. 19.5. Using Custom Item Renderers
        1. 19.5.1. Using drop-in item renderers
        2. 19.5.2. Using inline renderers and editors
        3. 19.5.3. Using component item renderers
        4. 19.5.4. Customizing Spark item renderers with view states
      6. 19.6. Summary
    3. 20. Using Advanced List Controls
      1. 20.1. Using ComboBox and DropDownList Controls
        1. 20.1.1. Using the prompt property
        2. 20.1.2. Using the ComboBox control
        3. 20.1.3. Selecting complex data objects with ActionScript
        4. 20.1.4. Using the Spark ButtonBar control
      2. 20.2. Using the DataGrid Control
        1. 20.2.1. Customizing the DataGrid display
          1. 20.2.1.1. The default columns display
          2. 20.2.1.2. Controlling the column display
        2. 20.2.2. Displaying custom labels in DataGrid column cells
          1. 20.2.2.1. Using a dynamic data field
          2. 20.2.2.2. Debugging a custom formatting function
      3. 20.3. Advanced Item Renderers and Editors
        1. 20.3.1. Using the dataChange event
        2. 20.3.2. Using Spark item renderers
        3. 20.3.3. Using item editors
          1. 20.3.3.1. Using drop-in item editors
          2. 20.3.3.2. Using the itemEditor and editorDataField properties
          3. 20.3.3.3. Using the rendererIsEditor property
          4. 20.3.3.4. Using inline and component editors
      4. 20.4. Using List Controls with Horizontal and Tile Layout
      5. 20.5. Using the AdvancedDataGrid Control
        1. 20.5.1. Hierarchical data display
        2. 20.5.2. Grouping flat data
      6. 20.6. Summary
    4. 21. Using the Flex Charting Controls
      1. 21.1. Understanding Flex's Types of Charts
      2. 21.2. Declaring Chart Controls
      3. 21.3. Setting Chart Properties and Styles
        1. 21.3.1. Using pie charts
          1. 21.3.1.1. Setting wedge labels
          2. 21.3.1.2. Exploding the pie
          3. 21.3.1.3. Creating a doughnut chart
          4. 21.3.1.4. Using multiple data series
          5. 21.3.1.5. Controlling fill colors and backgrounds
        2. 21.3.2. Using financial charts
        3. 21.3.3. Using bar, column, line, and area charts
          1. 21.3.3.1. Using bar and column charts
          2. 21.3.3.2. Using line and area charts
      4. 21.4. Summary
    5. 22. Working with Data Entry Forms
      1. 22.1. Using the Form Container
        1. 22.1.1. Using the FormHeading control
        2. 22.1.2. Using the FormItem container
          1. 22.1.2.1. Controlling label alignment
          2. 22.1.2.2. Controlling FormItem layout
        3. 22.1.3. Setting a default button
      2. 22.2. Using Custom Form Components
        1. 22.2.1. Creating a custom Form component
        2. 22.2.2. Adding controls to a Form component
      3. 22.3. Validating Data Entry
        1. 22.3.1. Creating a validator object
        2. 22.3.2. Controlling validation with trigger events
        3. 22.3.3. Controlling validation with ActionScript
          1. 22.3.3.1. Disabling validation trigger events
          2. 22.3.3.2. Triggering individual validator objects with ActionScript
          3. 22.3.3.3. Triggering multiple validator objects with ActionScript
        4. 22.3.4. Controlling validation rules and error messages
      4. 22.4. Sharing Data with the Application
        1. 22.4.1. Modeling Form data with a value object
          1. 22.4.1.1. Populating value object data with MXML
          2. 22.4.1.2. Populating value object data with ActionScript
        2. 22.4.2. Dispatching a custom event
      5. 22.5. Summary
    6. 23. Working with HTTPService and XML
      1. 23.1. Using RPC and REST Architectures
        1. 23.1.1. Understanding the Representational State Transfer architecture
        2. 23.1.2. Understanding the Remote Procedure Call architecture
      2. 23.2. Creating Data-Centric Applications with Flash Builder 4
        1. 23.2.1. Creating and managing data connections
          1. 23.2.1.1. Creating the service
          2. 23.2.1.2. Modifying the connection's properties
          3. 23.2.1.3. Reviewing the generated code
        2. 23.2.2. Defining a return data type
          1. 23.2.2.1. Generating the code
          2. 23.2.2.2. Reviewing the generated code
        3. 23.2.3. Binding returned data to visual controls
      3. 23.3. Declaring and Configuring HTTPService Objects
        1. 23.3.1. Creating an HTTPService object
        2. 23.3.2. Essential HTTPService properties
          1. 23.3.2.1. Setting the url property
          2. 23.3.2.2. Setting the method property
          3. 23.3.2.3. Setting the resultFormat property
          4. 23.3.2.4. Setting the concurrency property
      4. 23.4. Sending and Receiving Data
        1. 23.4.1. Understanding asynchronous communications
        2. 23.4.2. Handling HTTPService responses
          1. 23.4.2.1. Using a binding expression
          2. 23.4.2.2. Handling the result event
          3. 23.4.2.3. Handling the fault event
        3. 23.4.3. Working with CallResponder and AsyncToken
        4. 23.4.4. Working with ItemResponder and AsyncToken
      5. 23.5. Working with Value Objects
      6. 23.6. Passing Parameters to Server Pages
        1. 23.6.1. Using named parameters
        2. 23.6.2. Using bound parameters
      7. 23.7. Handling Cross-Domain Policy Issues
      8. 23.8. Summary
    7. 24. Managing XML with E4X
      1. 24.1. Using XML Classes
        1. 24.1.1. Creating an XML object
          1. 24.1.1.1. Declaring a hard-coded XML structure in ActionScript
          2. 24.1.1.2. Parsing an XML-formatted string value
          3. 24.1.1.3. Declaring an XML object in MXML
          4. 24.1.1.4. Importing XML with HTTPService
          5. 24.1.1.5. Controlling parsing with XML properties
        2. 24.1.2. Using the XMLList class
        3. 24.1.3. Using the XMLListCollection class
      2. 24.2. Using E4X Expressions
        1. 24.2.1. Extracting data from XML objects
          1. 24.2.1.1. Using dot notation
          2. 24.2.1.2. Using array notation
          3. 24.2.1.3. Using the descendant accessor operator
          4. 24.2.1.4. Filtering XML data with predicate expressions
        2. 24.2.2. Modifying data in XML objects
          1. 24.2.2.1. Changing existing values
          2. 24.2.2.2. Adding elements and attributes
          3. 24.2.2.3. Deleting elements and attributes
      3. 24.3. Working with Namespaces
      4. 24.4. Summary
  9. IV. Integrating Flex Applications with Application Servers
    1. 25. Working with SOAP-Based Web Services
      1. 25.1. Understanding SOAP
      2. 25.2. Understanding WSDL
      3. 25.3. Using the WebService Component
        1. 25.3.1. Installing ColdFusion
        2. 25.3.2. Creating a WebService object
          1. 25.3.2.1. Loading the WSDL content
          2. 25.3.2.2. Invoking an operation
          3. 25.3.2.3. Handling the load event
        3. 25.3.3. Handling Web service results
          1. 25.3.3.1. Using binding expressions
          2. 25.3.3.2. Using the result event
          3. 25.3.3.3. Handling fault events
          4. 25.3.3.4. Handling events of multiple operations
          5. 25.3.3.5. Using the CallResponder class
          6. 25.3.3.6. Processing Web service operations with ActionScript
        4. 25.3.4. Passing parameters to Web service operations
          1. 25.3.4.1. Using explicit parameters
          2. 25.3.4.2. Using bound parameters
      4. 25.4. Using Web Service Data Connections
        1. 25.4.1. Defining a data connection
        2. 25.4.2. Managing Web service data connections
          1. 25.4.2.1. Configuring a return type
          2. 25.4.2.2. Binding data to visual controls
      5. 25.5. Summary
    2. 26. Integrating Flex Applications with BlazeDS and Java
      1. 26.1. Using BlazeDS
        1. 26.1.1. Understanding supported platforms
        2. 26.1.2. Getting started with BlazeDS
          1. 26.1.2.1. Downloading BlazeDS
          2. 26.1.2.2. Starting BlazeDS in Windows
          3. 26.1.2.3. Starting BlazeDS on Mac OS X
          4. 26.1.2.4. Starting the sample database
          5. 26.1.2.5. Using the samples application
      2. 26.2. Creating Flex Projects for Use with BlazeDS
      3. 26.3. Using the Proxy Service
        1. 26.3.1. Configuring the Proxy Service
        2. 26.3.2. Using the default destination
        3. 26.3.3. Using named destinations
      4. 26.4. Using the Remoting Service
        1. 26.4.1. Creating and exposing Java classes
        2. 26.4.2. Configuring Remoting Service destinations
      5. 26.5. Using the RemoteObject Component
        1. 26.5.1. Instantiating the RemoteObject component
        2. 26.5.2. Calling remote methods
        3. 26.5.3. Handling RemoteObject results
          1. 26.5.3.1. Using binding expressions
          2. 26.5.3.2. Using the result event
          3. 26.5.3.3. Working with multiple methods
          4. 26.5.3.4. Using the CallResponder class
        4. 26.5.4. Passing arguments to remote methods
        5. 26.5.5. Passing data between ActionScript and Java
        6. 26.5.6. Using value object classes
      6. 26.6. Working with BlazeDS Data Connections in Flash Builder 4
        1. 26.6.1. Enabling RDS with BlazeDS
        2. 26.6.2. Defining BlazeDS data connections
      7. 26.7. Summary
    3. 27. Using the Message Service with BlazeDS
      1. 27.1. Understanding the Message Service
      2. 27.2. Configuring Messaging on the Server
        1. 27.2.1. Configuring channels for messaging
        2. 27.2.2. Configuring messaging adaptors and destinations
          1. 27.2.2.1. Configuring adaptors
          2. 27.2.2.2. Configuring destinations
      3. 27.3. Creating a Flex Messaging Application
        1. 27.3.1. Creating a Flex project
        2. 27.3.2. Sending messages
        3. 27.3.3. Receiving and processing messages
      4. 27.4. Sending and Receiving Complex Data
      5. 27.5. Filtering Messages on the Server
        1. 27.5.1. Using the selector property
        2. 27.5.2. Using subtopics
      6. 27.6. Tracing Messaging Traffic
      7. 27.7. Summary
    4. 28. Integrating Flex Applications with ColdFusion
      1. 28.1. Understanding Flash Remoting and ColdFusion
        1. 28.1.1. Creating a Flex project for use with ColdFusion
        2. 28.1.2. Configuring Flash Remoting on the server
      2. 28.2. Creating ColdFusion Components for Flex
      3. 28.3. Using CFCs with the RemoteObject Component
        1. 28.3.1. Setting the source property
        2. 28.3.2. Creating a RemoteObject instance
        3. 28.3.3. Calling CFC functions
      4. 28.4. Handling CFC Function Results
        1. 28.4.1. Using binding expressions
        2. 28.4.2. Using the result event
        3. 28.4.3. Handling results from multiple CFC functions
      5. 28.5. Passing Arguments to CFC Functions
        1. 28.5.1. Using explicit arguments
        2. 28.5.2. Using bound arguments
        3. 28.5.3. Using named arguments
      6. 28.6. Using Value Object Classes
        1. 28.6.1. Creating a ColdFusion value object
        2. 28.6.2. Creating an ActionScript value object
        3. 28.6.3. Returning value objects from ColdFusion to Flex
        4. 28.6.4. Receiving value objects from ColdFusion
        5. 28.6.5. Passing value object arguments to CFC functions
      7. 28.7. Working with RemoteObject Faults
        1. 28.7.1. Handling the fault event
        2. 28.7.2. Generating custom exceptions from a CFC function
      8. 28.8. Working with Data Connections in Flash Builder
      9. 28.9. Calling ColdFusion 9 Services
        1. 28.9.1. Configuring ColdFusion security
          1. 28.9.1.1. Creating a User Profile
          2. 28.9.1.2. Specifying IP addresses
        2. 28.9.2. Using ColdFusion 9 client-side service components
          1. 28.9.2.1. Adding cfservices.swc to a Flex project
          2. 28.9.2.2. Calling services
      10. 28.10. Summary
    5. 29. Integrating Flex Applications with PHP
      1. 29.1. Installing PHP
        1. 29.1.1. Installing WampServer on Windows
        2. 29.1.2. Managing WampServer
        3. 29.1.3. Installing MAMP on Mac OS X
        4. 29.1.4. Managing MAMP servers
      2. 29.2. Creating a Flex Project for Use with PHP
      3. 29.3. Using PHP with HTTPService and XML
        1. 29.3.1. Using the PHP SimpleXML extension
        2. 29.3.2. Retrieving XML data with HTTPService
      4. 29.4. Using PHP and Remoting with Zend AMF
        1. 29.4.1. Installing Zend AMF
        2. 29.4.2. Creating a service class in PHP
        3. 29.4.3. Calling a PHP class with RemoteObject
        4. 29.4.4. Returning complex data from Zend AMF
        5. 29.4.5. Understanding ActionScript to PHP data serialization
      5. 29.5. Using PHP Data Connections in Flash Builder
        1. 29.5.1. Defining data connections
        2. 29.5.2. Generating a service based on a database table structure
      6. 29.6. Summary
  10. V. Additional Subjects
    1. 30. Localizing Flex 4 Applications
      1. 30.1. Using Locales to Select Application Resources
        1. 30.1.1. Changing locales at compile time
        2. 30.1.2. Changing locales at runtime
      2. 30.2. Using Custom Resource Bundles
        1. 30.2.1. Creating resource bundles at runtime
        2. 30.2.2. Using external resource bundles
      3. 30.3. Summary
    2. 31. Deploying Desktop Applications with Adobe AIR
      1. 31.1. Understanding AIR Architecture
      2. 31.2. Installing Adobe AIR
        1. 31.2.1. Downloading the AIR installer
        2. 31.2.2. Installing and uninstalling AIR on Windows
        3. 31.2.3. Installing and uninstalling AIR on Mac OS X
      3. 31.3. Creating a Flex Desktop Application
        1. 31.3.1. Creating a Flex desktop application project
        2. 31.3.2. Using the application descriptor file
        3. 31.3.3. Packaging a release version of an AIR application
        4. 31.3.4. Installing AIR applications
        5. 31.3.5. Uninstalling AIR applications
      4. 31.4. Flex Application Tips and Tricks with AIR
        1. 31.4.1. Debugging AIR applications in Flash Builder
        2. 31.4.2. Working with HTML-based content
          1. 31.4.2.1. Instantiating the HTML control
          2. 31.4.2.2. Navigating with the HTML control
        3. 31.4.3. Using the WindowedApplication component
        4. 31.4.4. Creating Remoting channels at runtime
      5. 31.5. A Conclusion about Adobe AIR
      6. 31.6. Summary

Product information

  • Title: Flash® Builder™ 4 and Flex® 4 Bible
  • Author(s):
  • Release date: April 2010
  • Publisher(s): Wiley
  • ISBN: 9780470488959