You are previewing Professional Adobe® Flex® 3.
O'Reilly logo
Professional Adobe® Flex® 3

Book Description

With Professional Adobe Flex 3, put your prior experience with Flash, ActionScript and XML-based languages to good use and learn how to use the Flex 3 platform to create Rich Internet Applications and AIR applications. Understand the potential of the Flex 3 platform through practical examples and hands-on advice on topics like desktop deployment, developing applications in MXML, creating custom flex components, charting, targeting AIR, and data interconnectivity.

Table of Contents

  1. Copyright
  2. About the Authors
  3. Credits
  4. Acknowledgments
  5. Foreword
    1. Innovate on Both Sides of the Glass
    2. Developing Rich Internet Applications with Adobe Flex
    3. What Lies Ahead
  6. Introduction
    1. Who This Book Is For
    2. What This Book Covers
    3. How This Book Is Structured
    4. What You Need to Use This Book
    5. Conventions
    6. Source Code
    7. Errata
    8. p2p.wrox.com
  7. I. Introduction to Flex 3
    1. 1. Why Flex?
      1. 1.1. What Is Flex?
      2. 1.2. What Is an RIA?
        1. 1.2.1. Clarifying the Competition
      3. 1.3. For the Love of Flex
        1. 1.3.1. Bursting Myths about Flash and Flex
        2. 1.3.2. 10 Reasons to Love Flex
      4. 1.4. Summary
    2. 2. The Flex 3 Ecosystem
      1. 2.1. A (Not So) Brief History of Flex
      2. 2.2. The Adobe Flex 3 Ecosystem
        1. 2.2.1. Runtimes
          1. 2.2.1.1. Flash Player
            1. 2.2.1.1.1. ActionScript Virtual Machine 1 (AVM1)
            2. 2.2.1.1.2. ActionScript Virtual Machine 2 (AVM2)
            3. 2.2.1.1.3. Flash APIs in the Virtual Machine
            4. 2.2.1.1.4. Flash Player 9 Releases
            5. 2.2.1.1.5. Flash Player 10 Releases
            6. 2.2.1.1.6. Tamarin
          2. 2.2.1.2. Adobe AIR
            1. 2.2.1.2.1. Technologies
            2. 2.2.1.2.2. Cross-Rendering Capabilities
            3. 2.2.1.2.3. System Access
            4. 2.2.1.2.4. The Power of AIR
        2. 2.2.2. Languages
          1. 2.2.2.1. ActionScript 3.0
          2. 2.2.2.2. MXML and CSS
          3. 2.2.2.3. Pixel Bender
          4. 2.2.2.4. Flex Builder 3
          5. 2.2.2.5. The Flex SDK
          6. 2.2.2.6. Pixel Bender (AIF) Toolkit
        3. 2.2.3. Frameworks and APIs
          1. 2.2.3.1. Flash Player APIs
          2. 2.2.3.2. The Flex Framework
          3. 2.2.3.3. The AIR APIs
          4. 2.2.3.4. Other Adobe Frameworks
          5. 2.2.3.5. Third-Party Frameworks and Components
        4. 2.2.4. Data Communications
          1. 2.2.4.1. Protocols
          2. 2.2.4.2. Data Formats
        5. 2.2.5. Servers
          1. 2.2.5.1. Flash Media Server
          2. 2.2.5.2. ConnectNow
          3. 2.2.5.3. ColdFusion
          4. 2.2.5.4. LiveCycle Data Services ES
          5. 2.2.5.5. BlazeDS
      3. 2.3. The Adobe Flex RIA Process Flow
        1. 2.3.1. Design and Development
        2. 2.3.2. Execution
        3. 2.3.3. Communication
        4. 2.3.4. Infrastructure
      4. 2.4. Future Additions to the Flex Ecosystem
      5. 2.5. Summary
    3. 3. ActionScript 3.0 Fundamentals
      1. 3.1. Core Language Concepts
        1. 3.1.1. Basic Syntax
        2. 3.1.2. Reserved Keywords
        3. 3.1.3. Variables and Data types
      2. 3.2. Control Structures
        1. 3.2.1. Conditional Statements
          1. 3.2.1.1. The if[..else [if]] Statement
          2. 3.2.1.2. The switch Statement
          3. 3.2.1.3. The Conditional Operator
        2. 3.2.2. Loops
          1. 3.2.2.1. The for Statement
          2. 3.2.2.2. The while/do..while Statements
      3. 3.3. Using Classes and Data types
        1. 3.3.1. Value Types
        2. 3.3.2. Numbers
        3. 3.3.3. Strings
        4. 3.3.4. Arrays
        5. 3.3.5. Vectors
        6. 3.3.6. Objects
        7. 3.3.7. Casting
          1. 3.3.7.1. Implicit Casting
          2. 3.3.7.2. Explicit Casting
          3. 3.3.7.3. The as Operator
        8. 3.3.8. Introspection
          1. 3.3.8.1. The in Operator
          2. 3.3.8.2. The is Operator
          3. 3.3.8.3. The instanceof Operator
          4. 3.3.8.4. The typeof Operator
          5. 3.3.8.5. The for . . in Operator
          6. 3.3.8.6. The for each . . in Operator
      4. 3.4. Object-Oriented Programming
        1. 3.4.1. The Class Object
        2. 3.4.2. Packages and Classes
        3. 3.4.3. Class Attributes
        4. 3.4.4. Class Members
          1. 3.4.4.1. Properties and Methods
          2. 3.4.4.2. Method Parameters
          3. 3.4.4.3. Constructor Methods
          4. 3.4.4.4. Access Modifiers
          5. 3.4.4.5. Namespaces
          6. 3.4.4.6. Static versus Instance Members
          7. 3.4.4.7. Constants
          8. 3.4.4.8. Getters and Setters
        5. 3.4.5. Interfaces and Inheritance
      5. 3.5. Summary
    4. 4. Using ActionScript 3.0
      1. 4.1. The Flash Platform Framework
      2. 4.2. Display Programming
        1. 4.2.1. Understanding the Display Architecture
      3. 4.3. The Event Model
        1. 4.3.1. Event Classes and Types
        2. 4.3.2. Event Process
        3. 4.3.3. Event Flow
        4. 4.3.4. The EventDispatcher Class
      4. 4.4. The Flash Player APIs
        1. 4.4.1. The Display API
          1. 4.4.1.1. Manipulating the Display List
          2. 4.4.1.2. Appearance and Spatial Properties
          3. 4.4.1.3. Finding Display Objects
          4. 4.4.1.4. Event Handling
        2. 4.4.2. The Flash AIR APIs
        3. 4.4.3. Flash 10 APIs
          1. 4.4.3.1. 3D Graphics and Pixel Bender
          2. 4.4.3.2. Flash Text Engine
          3. 4.4.3.3. System Integration
          4. 4.4.3.4. Media
      5. 4.5. Summary
    5. 5. Introduction to Flex Builder 3
      1. 5.1. Getting Started with Flex Builder
        1. 5.1.1. Flex Builder and Eclipse
        2. 5.1.2. Learning Flex and Getting Help
      2. 5.2. The Flex 3 Workbench
        1. 5.2.1. Workspaces
          1. 5.2.1.1. Creating and Switching Workspaces
          2. 5.2.1.2. Workspace Configurations
        2. 5.2.2. Editors
        3. 5.2.3. Views
        4. 5.2.4. Perspectives
          1. 5.2.4.1. Creating a Custom Perspective
      3. 5.3. What's New in Flex Builder 3
        1. 5.3.1. New Wizards
        2. 5.3.2. Design Mode Enhancements
        3. 5.3.3. Development Enhancements
        4. 5.3.4. CS3 Suite Integration
      4. 5.4. Summary
  8. II. Developing with Flex 3
    1. 6. Using Flex Builder 3
      1. 6.1. The Flex Compilation Process
        1. 6.1.1. Development
        2. 6.1.2. Compilation
        3. 6.1.3. Publishing
      2. 6.2. About Projects
        1. 6.2.1. Creating New Projects
      3. 6.3. Creating a Flex Application
        1. 6.3.1. Creating a Flex Project
        2. 6.3.2. Using Design Mode
          1. 6.3.2.1. Using the Components and Properties Views
          2. 6.3.2.2. Using Layout Constraints
          3. 6.3.2.3. Navigating the Design Area
          4. 6.3.2.4. Viewing the Display Hierarchy
          5. 6.3.2.5. Working with Fast Views
        3. 6.3.3. Using Data Binding
        4. 6.3.4. Using Triggers and Effects
        5. 6.3.5. Compiling Your Application
      4. 6.4. Creating an ActionScript Application
        1. 6.4.1. Creating an ActionScript Project
        2. 6.4.2. Comparing File Sizes
      5. 6.5. The (Undocumented) [SWF] Metadata Tag
        1. 6.5.1. [SWF] Metadata Properties
      6. 6.6. Summary
    2. 7. MXML Fundamentals
      1. 7.1. Language Principles
        1. 7.1.1. MXML Is XML
        2. 7.1.2. Naming Conventions
        3. 7.1.3. MXML Syntax
        4. 7.1.4. Display Hierarchy
        5. 7.1.5. MXML Namespaces
          1. 7.1.5.1. Namespaces and URIs
          2. 7.1.5.2. Namespaces and Packages
          3. 7.1.5.3. The Local Namespace
          4. 7.1.5.4. The Null Namespace
      2. 7.2. Using MXML
        1. 7.2.1. MXML Tags
          1. 7.2.1.1. Component Tags
          2. 7.2.1.2. Interpreted Tags
          3. 7.2.1.3. Core Data types in MXML
        2. 7.2.2. MXML Properties
          1. 7.2.2.1. Property Attributes
            1. 7.2.2.1.1. Typing in MXML Properties
            2. 7.2.2.1.2. Text Properties
          2. 7.2.2.2. Property Tags
            1. 7.2.2.2.1. Escaping HTML Markup
            2. 7.2.2.2.2. Objects as Values
        3. 7.2.3. Using MXML and CSS
          1. 7.2.3.1. Inline CSS
          2. 7.2.3.2. The Style Tag
          3. 7.2.3.3. Linking External CSS
        4. 7.2.4. Using MXML and ActionScript
          1. 7.2.4.1. Inline ActionScript
            1. 7.2.4.1.1. Data Binding
            2. 7.2.4.1.2. Inline Event Script
            3. 7.2.4.1.3. Script in a Property Tag
          2. 7.2.4.2. The Script Tag
          3. 7.2.4.3. Functions in MXML
            1. 7.2.4.3.1. Property Tag as Anonymous Function
            2. 7.2.4.3.2. The Function Tag
          4. 7.2.4.4. Linking External ActionScript
          5. 7.2.4.5. Rules of Usage
          6. 7.2.4.6. MXML or ActionScript?
      3. 7.3. Summary
    3. 8. Developing with Flex Builder 3
      1. 8.1. Managing Projects
        1. 8.1.1. Project Properties
          1. 8.1.1.1. Project Settings Files
          2. 8.1.1.2. Flex Applications Settings
            1. 8.1.1.2.1. The Applications List
          3. 8.1.1.3. Flex Build Path Settings
          4. 8.1.1.4. Flex Compiler Settings
          5. 8.1.1.5. Other Settings
        2. 8.1.2. Exporting Projects
        3. 8.1.3. Importing Projects
          1. 8.1.3.1. Importing Single Projects
          2. 8.1.3.2. Importing Multiple Projects
            1. 8.1.3.2.1. From a ZIP Archive
            2. 8.1.3.2.2. From a Directory
            3. 8.1.3.2.3. From a Repository
        4. 8.1.4. Navigating Projects
          1. 8.1.4.1. Creating a Folder Structure
          2. 8.1.4.2. Creating Folder Linkages
          3. 8.1.4.3. Creating File Linkages
          4. 8.1.4.4. "Go Into" Browsing
          5. 8.1.4.5. Working Sets
          6. 8.1.4.6. Navigator Filters
          7. 8.1.4.7. Link With Editor
      2. 8.2. Building Applications
        1. 8.2.1. Creating a Debug Release
        2. 8.2.2. Creating an Export Release
        3. 8.2.3. Enabling Source View
          1. 8.2.3.1. Using a Custom Source View URL
      3. 8.3. Language Intelligence
        1. 8.3.1. Code Editing
          1. 8.3.1.1. ActionScript Code Assist
          2. 8.3.1.2. Syntax Highlighting
          3. 8.3.1.3. MXML Code Assist
          4. 8.3.1.4. Mark Occurrences
        2. 8.3.2. Code Preferences
        3. 8.3.3. Code Introspection
          1. 8.3.3.1. The Class Outline View
          2. 8.3.3.2. Class Outline Sort Options
          3. 8.3.3.3. Other Outline Views
        4. 8.3.4. Keyboard Shortcuts
          1. 8.3.4.1. Some Useful Shortcuts
      4. 8.4. Summary
    4. 9. Customizing Flex Builder 3
      1. 9.1. Optimizing Flex Builder Performance
        1. 9.1.1. Project Development Best Practices
        2. 9.1.2. Eclipse Performance Management
          1. 9.1.2.1. The Heap Status Indicator
          2. 9.1.2.2. Why Compilation Slows Down
          3. 9.1.2.3. Command-Line Startup Options
            1. 9.1.2.3.1. Workbench Optimizations
            2. 9.1.2.3.2. Memory Tuning
            3. 9.1.2.3.3. Other Startup Arguments
      2. 9.2. Customizing the Workbench
        1. 9.2.1. Editing the Workspaces List
        2. 9.2.2. Using Custom Shortcuts
        3. 9.2.3. Layouts for Productivity
          1. 9.2.3.1. Repositioning Views
          2. 9.2.3.2. Creating Custom Perspectives
        4. 9.2.4. Managing Workspace Preferences
      3. 9.3. Using Code Repositories in Flex Builder
        1. 9.3.1. Using the Local History
          1. 9.3.1.1. Compare with Local History
          2. 9.3.1.2. Local History Preferences
          3. 9.3.1.3. Recovering Deleted Files
        2. 9.3.2. Subclipse for Subversion Source Management
          1. 9.3.2.1. Installing Subclipse
          2. 9.3.2.2. The Subclipse Perspectives
          3. 9.3.2.3. Establishing a Repository
          4. 9.3.2.4. Creating a Repository Location in Subclipse
          5. 9.3.2.5. Sharing a Project with the Repository
          6. 9.3.2.6. Creating a Project from the Repository
            1. 9.3.2.6.1. Check Out As New Project
            2. 9.3.2.6.2. Check Out As Flex Builder Project
          7. 9.3.2.7. Project Management for Multiple Repositories
          8. 9.3.2.8. Disconnecting a Local Project
          9. 9.3.2.9. Using Subclipse
          10. 9.3.2.10. Subclipse Settings
            1. 9.3.2.10.1. Secure Connectivity Made Simple
            2. 9.3.2.10.2. Customizing Labels
          11. 9.3.2.11. Migrating Subclipse Preferences
          12. 9.3.2.12. Bug Tracking and Subclipse in Flex Builder
      4. 9.4. Summary
  9. III. Working with Components
    1. 10. The Component Life Cycle and Class Hierarchy
      1. 10.1. The Role of Flash in Flex Applications
      2. 10.2. The Flex Framework Life Cycle
        1. 10.2.1. Frame-by-Frame
        2. 10.2.2. The Life Cycle
      3. 10.3. Flex Class Hierarchy
        1. 10.3.1. Flash and Flex Class Packages
        2. 10.3.2. UIComponent
        3. 10.3.3. Container Classes
        4. 10.3.4. List Classes
        5. 10.3.5. Formatters, Validators, and Collection Classes
        6. 10.3.6. Framework Functions and Events
      4. 10.4. Summary
    2. 11. Using Data Binding and Events
      1. 11.1. Using {Curly Braces}
      2. 11.2. [Bindable] Metadata
      3. 11.3. Events
        1. 11.3.1. Capture Phase
        2. 11.3.2. Target Phase
        3. 11.3.3. Bubbling Phase
      4. 11.4. Stopping Events
      5. 11.5. Event Listeners
        1. 11.5.1. Using MXML
        2. 11.5.2. Using ActionScript
      6. 11.6. Event Types
      7. 11.7. Custom Events
        1. 11.7.1. Creating Custom Events
        2. 11.7.2. [Event] Metadata
        3. 11.7.3. Strategies for Using Custom Events
      8. 11.8. Summary
    3. 12. User Interface Controls and Containers
      1. 12.1. Static Controls
        1. 12.1.1. mx.controls.Label and mx.controls.Text
        2. 12.1.2. mx.controls.Image
        3. 12.1.3. mx.controls.SWFLoader
        4. 12.1.4. mx.controls.HRule and mx.controls.VRule
        5. 12.1.5. mx.controls.ProgressBar
      2. 12.2. Input Controls
        1. 12.2.1. mx.controls.Button and mx.controls.LinkButton
        2. 12.2.2. mx.controls.TextInput and mx.controls.TextArea
        3. 12.2.3. mx.controls.NumericStepper
        4. 12.2.4. mx.controls.DateChooser and mx.controls.DateField
        5. 12.2.5. mx.controls.CheckBox
        6. 12.2.6. mx.controls.ComboBox
        7. 12.2.7. mx.controls.RadioButton and mx.controls.RadioButtonGroup
        8. 12.2.8. mx.controls.HSlider and mx.controls.VSlider
        9. 12.2.9. mx.controls.RichTextEditor
        10. 12.2.10. mx.controls.PopUpButton
        11. 12.2.11. mx.controls.PopUpMenuButton
        12. 12.2.12. mx.controls.ColorPicker
      3. 12.3. Layout Containers
        1. 12.3.1. mx.containers.Canvas
        2. 12.3.2. mx.container.VBox and mx.container.HBox
        3. 12.3.3. mx.containers.HDividedBox and mx.containers.VDividedBox
        4. 12.3.4. mx.core.Application, mx.containers.Panel, mx.containers.TitleWindow
        5. 12.3.5. mx.containers.Grid
        6. 12.3.6. mx.containers.Tile
        7. 12.3.7. mx.containers.Form
        8. 12.3.8. mx.containers.ControlBar
        9. 12.3.9. mx.containers.ApplicationControlBar
      4. 12.4. Navigation Components
        1. 12.4.1. creationPolicy
        2. 12.4.2. mx.containers.Accordion
        3. 12.4.3. mx.containers.TabNavigator
        4. 12.4.4. mx.containers.ViewStack
        5. 12.4.5. mx.controls.LinkBar
        6. 12.4.6. mx.controls.TabBar
        7. 12.4.7. mx.containers.MenuBar and mx.controls.Menu
        8. 12.4.8. mx.controls.ButtonBar and mx.controls.ToggleButtonBar
      5. 12.5. List Controls
      6. 12.6. Summary
    4. 13. Layout Strategies
      1. 13.1. Coordinate Positioning
      2. 13.2. Constraint Positioning
      3. 13.3. Positioning by Percentage
      4. 13.4. Positioning by Alignment
      5. 13.5. Advanced Constraints
        1. 13.5.1. ConstraintColumns
        2. 13.5.2. ConstraintRows
        3. 13.5.3. Constraints in ActionScript
        4. 13.5.4. Constraint Sizes
      6. 13.6. Using includeInLayout
      7. 13.7. Performance Considerations
      8. 13.8. Summary
    5. 14. User Interface Integration
      1. 14.1. Creating Forms
        1. 14.1.1. Submitting Form Content
        2. 14.1.2. Building Forms with Flex Builder Design View
        3. 14.1.3. Setting the defaultButton on the Form
      2. 14.2. Customizing Tooltips
        1. 14.2.1. Custom ToolTips
      3. 14.3. Creating Pop-Ups
        1. 14.3.1. Alerts
        2. 14.3.2. Using the PopUpManager
        3. 14.3.3. Interacting with Pop-Ups
      4. 14.4. Custom Cursors
        1. 14.4.1. Cursor Management
        2. 14.4.2. Busy Cursors
        3. 14.4.3. Hand Cursors
        4. 14.4.4. Custom Cursors
      5. 14.5. Summary
    6. 15. Getting Started with AIR
      1. 15.1. What Does AIR Provide?
        1. 15.1.1. Why Use AIR?
        2. 15.1.2. Applications That Can Be Built with AIR
        3. 15.1.3. Requirements for AIR
          1. 15.1.3.1. Developer Requirements
          2. 15.1.3.2. The Command-Line Tools
          3. 15.1.3.3. User Runtime Requirements
      2. 15.2. Building an AIR Application
        1. 15.2.1. The IntroToAIR.mxml File
        2. 15.2.2. The IntroToAIR-app.xml Descriptor File
      3. 15.3. The AIR Configuration File
        1. 15.3.1.
          1. 15.3.1.1. The Application Configuration Tags
            1. 15.3.1.1.1. Id
            2. 15.3.1.1.2. filename
            3. 15.3.1.1.3. name
            4. 15.3.1.1.4. version
            5. 15.3.1.1.5. description
            6. 15.3.1.1.6. copyright
          2. 15.3.1.2. Initial Window Tags
            1. 15.3.1.2.1. content
            2. 15.3.1.2.2. title
            3. 15.3.1.2.3. systemChrome
            4. 15.3.1.2.4. transparent
            5. 15.3.1.2.5. visible
            6. 15.3.1.2.6. minimizable
            7. 15.3.1.2.7. maximizable
            8. 15.3.1.2.8. resizable
            9. 15.3.1.2.9. width and height
            10. 15.3.1.2.10. x and y
            11. 15.3.1.2.11. minSize and maxSize
          3. 15.3.1.3. The Remaining Configuration Tags
            1. 15.3.1.3.1. installFolder
            2. 15.3.1.3.2. programMenuFolder
            3. 15.3.1.3.3. icon
            4. 15.3.1.3.4. customUpdateUI
            5. 15.3.1.3.5. allowBrowserInvocation
            6. 15.3.1.3.6. fileTypes
      4. 15.4. Building an AIR Application Part II
        1. 15.4.1. Modifying the IntroToAIR.mxml Window
        2. 15.4.2. The MainWindow.mxml File
        3. 15.4.3. The IntroToAIR-app.xml Descriptor File
      5. 15.5. Summary
  10. IV. Advanced Component Development
    1. 16. Custom ActionScript Components
      1. 16.1. Company Logo Example
        1. 16.1.1. UIComponent and IUIComponent
        2. 16.1.2. CompanyLogo.as
      2. 16.2. Component Structure
        1. 16.2.1. Component Properties and the Flex Framework Life Cycle
        2. 16.2.2. Invalidate Functions
        3. 16.2.3. Adding Child Components
        4. 16.2.4. Using invalidateProperties() and Applying Properties to the Component
        5. 16.2.5. Measuring Components
        6. 16.2.6. Component Layout
        7. 16.2.7. Selecting the Base Class for Your Component
        8. 16.2.8. Sizing Child Components
      3. 16.3. RockerSwitch Example
      4. 16.4. Summary
    2. 17. Custom MXML Components
      1. 17.1. MXML Versus ActionScript Components
      2. 17.2. Customizing the Layout
        1. 17.2.1. Overriding updateDisplayList()
        2. 17.2.2. Overriding layoutChrome()
        3. 17.2.3. Setting Up Metadata Tags
      3. 17.3. Creating Template Components
        1. 17.3.1. DefaultProperty Meta Tag
        2. 17.3.2. Creating Custom Children
      4. 17.4. Extending MXML Components
      5. 17.5. Summary
    3. 18. Extending Flex Components
      1. 18.1. A Look at Composite Components
      2. 18.2. Creating Composite Components
        1. 18.2.1. Properties
        2. 18.2.2. Events
        3. 18.2.3. Layout
      3. 18.3. Extending Existing Components
        1. 18.3.1. Extending Button
        2. 18.3.2. Extending TextInput
        3. 18.3.3. Extending UIComponents versus Standard Components
        4. 18.3.4. Appearance versus Behavior
      4. 18.4. Custom Containers
        1. 18.4.1. Applying the Flex Component Life Cycle
        2. 18.4.2. Tag Cloud
        3. 18.4.3. Customizing Composite Components
      5. 18.5. Summary
    4. 19. Advanced Event Programming
      1. 19.1. Custom Events versus Standard Events
        1. 19.1.1. Extending Standard Events
        2. 19.1.2. One versus Many
      2. 19.2. Adding Metadata to AS Class and MXML Files
        1. 19.2.1. Adding Custom Events to Custom Components
        2. 19.2.2. Handling Event Runtime Errors
      3. 19.3. Event Flow
        1. 19.3.1. Event Priority
        2. 19.3.2. Preventing or Changing Default Behaviors
        3. 19.3.3. Forwarding Events
      4. 19.4. Custom Data Binding
        1. 19.4.1. Using the Bindable Metadata Tag
        2. 19.4.2. Custom Data Binding with the Bindable Metadata Tag
      5. 19.5. Using BindingUtils
        1. 19.5.1. Custom Data Binding in ActionScript
        2. 19.5.2. ChangeWatcher
      6. 19.6. Summary
    5. 20. State Management
      1. 20.1. What Are States?
        1. 20.1.1. The States Property
      2. 20.2. Adding States
        1. 20.2.1. Creating States Using Flex Builder's Design View
        2. 20.2.2. Changing States
        3. 20.2.3. Testing the Example
      3. 20.3. Understanding the MXML Tags
        1. 20.3.1. Adding Components
        2. 20.3.2. Removing Components
        3. 20.3.3. Gone, But Not Destroyed
        4. 20.3.4. Setting and Changing Properties and Styles
        5. 20.3.5. Changing Event Handlers
        6. 20.3.6. Data Binding
      4. 20.4. Creating States in ActionScript
      5. 20.5. Real Estate Management
      6. 20.6. Common Problems
        1. 20.6.1. States versus ViewStacks
        2. 20.6.2. Optimization
      7. 20.7. Anticipating Transitions
      8. 20.8. Summary
    6. 21. Using Libraries
      1. 21.1. ActionScript Libraries
        1. 21.1.1. Flash Player Library
        2. 21.1.2. Flex Libraries
      2. 21.2. SWCs versus SWFs
        1. 21.2.1. Anatomy of a SWC
      3. 21.3. Creating a Library with Flex Builder
        1. 21.3.1. Creating a Library Project
        2. 21.3.2. Adding Sources
        3. 21.3.3. Creating the SWC
      4. 21.4. Creating Libraries with COMPC
        1. 21.4.1. COMPC Options
        2. 21.4.2. Adding Assets
        3. 21.4.3. Specifying the Manifest File
      5. 21.5. Best Practices for Component Libraries
        1. 21.5.1. Sharing Source Directories
        2. 21.5.2. Build to Sell
      6. 21.6. Using Libraries
        1. 21.6.1. The libs Folder
        2. 21.6.2. The Build Path
        3. 21.6.3. Using Assets from Libraries
        4. 21.6.4. Using SWC Files
      7. 21.7. Summary
  11. V. Visual Effects and Multimedia
    1. 22. Styles
      1. 22.1. What Are CSS Styles?
        1. 22.1.1. Inline Styling Versus CSS
        2. 22.1.2. Component Styles
        3. 22.1.3. CSS Constraint-Based Layout
        4. 22.1.4. CSS Styles and Class Inheritance
        5. 22.1.5. CSS Styles and Subcomponents
      2. 22.2. Summary
    2. 23. Skinning and Themes
      1. 23.1. What Are Skins?
        1. 23.1.1. Embedded Assets
        2. 23.1.2. Programmatic Skins
        3. 23.1.3. Applying Skins
        4. 23.1.4. Defining Skins per Object
        5. 23.1.5. Defining Skins in Style Sheets
        6. 23.1.6. Scaling and Scale-9 Grids
        7. 23.1.7. Changing Styles at Runtime
      2. 23.2. Themes
        1. 23.2.1. Default Flex 3 Themes
        2. 23.2.2. Applying Themes
        3. 23.2.3. Creating Themes
        4. 23.2.4. Separating Themes to Libraries
      3. 23.3. Summary
    3. 24. Visual Effects
      1. 24.1. What Are Flex Effects?
        1. 24.1.1. Built-In Flex Effects
          1. 24.1.1.1. AnimateProperty
          2. 24.1.1.2. Blur
          3. 24.1.1.3. Dissolve
          4. 24.1.1.4. Fade
          5. 24.1.1.5. Glow
          6. 24.1.1.6. Iris
          7. 24.1.1.7. Move
          8. 24.1.1.8. Pause
          9. 24.1.1.9. Resize
          10. 24.1.1.10. Rotate
          11. 24.1.1.11. SoundEffect
          12. 24.1.1.12. WipeLeft/WipeRight/WipeUp/WipeDown
          13. 24.1.1.13. Zoom
        2. 24.1.2. Applying Effects
          1. 24.1.2.1. Event Triggers
          2. 24.1.2.2. Manual Invocation
        3. 24.1.3. Data Effects
        4. 24.1.4. Easing Functions
        5. 24.1.5. Composite Effects
          1. 24.1.5.1. Parallel Effects
          2. 24.1.5.2. Sequence Effects
          3. 24.1.5.3. Nested Effects
        6. 24.1.6. Transitions
        7. 24.1.7. Effect Events
        8. 24.1.8. 3D Effects
        9. 24.1.9. Flex 4 Effects
      2. 24.2. Summary
    4. 25. Dynamic Skinning and the Drawing API
      1. 25.1. Understanding the Drawing API
        1. 25.1.1. Basic Programmatic Drawing
          1. 25.1.1.1. Lines
          2. 25.1.1.2. Curves
          3. 25.1.1.3. Shapes
          4. 25.1.1.4. Fills
            1. 25.1.1.4.1. Solid Fills
            2. 25.1.1.4.2. Gradient Fills
            3. 25.1.1.4.3. Bitmap Fills
            4. 25.1.1.4.4. Complex Fills
      2. 25.2. Programmatic Skins
        1. 25.2.1. Creating and Applying Programmatic Skins
      3. 25.3. Additional Drawing API Capabilities
        1. 25.3.1. Masks
        2. 25.3.2. Filters
        3. 25.3.3. Blend Modes
        4. 25.3.4. Degrafa
      4. 25.4. Summary
    5. 26. Flash Integration
      1. 26.1. Flash Platform Development Workflows
      2. 26.2. The Flash-Flex Workflow
      3. 26.3. Creating Flex Component Skins in Flash
        1. 26.3.1. Using the Flex Skin Design Extension
      4. 26.4. Skinning a Custom Flex Component
        1. 26.4.1. Planning Your Custom Flex Component
        2. 26.4.2. Building the Flex Component
        3. 26.4.3. Building the Flash Skin
        4. 26.4.4. Skinning the Flex Component
          1. 26.4.4.1. Using the Import Skin Artwork Wizard
          2. 26.4.4.2. Mapping Symbols to Subcomponent Styles
          3. 26.4.4.3. Testing the Skin
      5. 26.5. Summary
    6. 27. Loading External Assets
      1. 27.1. Loading Images
      2. 27.2. The SWFLoader Class
      3. 27.3. The Loader Class
      4. 27.4. Runtime Shared Libraries
      5. 27.5. Summary
    7. 28. Video and Sound
      1. 28.1. Methods for Bringing in Media
        1. 28.1.1. Usable File Formats
        2. 28.1.2. Integrating the Media Content
          1. 28.1.2.1. Exercise 1: Embedding Sound in ActionScript
          2. 28.1.2.2. Exercise 2: Embedding Sound in MXML
      2. 28.2. Understanding Progressive Loading and Streaming
        1. 28.2.1. The Sound Class
        2. 28.2.2. The SoundLoaderContext Class
        3. 28.2.3. Playing and Controlling Sound
          1. 28.2.3.1. Exercise 3: Controlling Sound
            1. 28.2.3.1.1. Loading Audio
            2. 28.2.3.1.2. Controlling Sound
            3. 28.2.3.1.3. Setting SoundTransforms
        4. 28.2.4. Accessing ID3 Information
          1. 28.2.4.1. Exercise 4: Accessing Sound Metadata
        5. 28.2.5. The SoundMixer Class
        6. 28.2.6. The Microphone Class
      3. 28.3. Video
        1. 28.3.1. Video Classes and Components
          1. 28.3.1.1. Exercise 5: Displaying Video
            1. 28.3.1.1.1. Loading Video
            2. 28.3.1.1.2. Handling Metadata
            3. 28.3.1.1.3. Controlling Video
        2. 28.3.2. The VideoDisplay Component
          1. 28.3.2.1. Exercise 6: Using the VideoDisplay Component
            1. 28.3.2.1.1. Loading Video
            2. 28.3.2.1.2. Controlling the Video
        3. 28.3.3. Cue Points
        4. 28.3.4. The Camera Class
        5. 28.3.5. Undocumented Video Classes
        6. 28.3.6. Flash Player MovieStar Update
          1. 28.3.6.1. Exercise 7: Full-Screen Video Display
            1. 28.3.6.1.1. Making the Video Display Full-Screen
            2. 28.3.6.1.2. Loading Image Data from Metadata
      4. 28.4. Summary
    8. 29. Advanced Flash Integration
      1. 29.1. Bringing Flex Classes into Flash
        1. 29.1.1. Importing Custom Flex Classes through RSLs
        2. 29.1.2. Importing Native Flex Classes
      2. 29.2. Bringing Flash into Flex
        1. 29.2.1. The Flex Component Kit for Flash CS3
          1. 29.2.1.1. Exercise 1: Using the Flex Component Kit For Flash CS3
            1. 29.2.1.1.1. Creating a Custom Flex Component Using the Flex Component Kit
            2. 29.2.1.1.2. Using the Custom Component in a Flex Application
            3. 29.2.1.1.3. Setting Up the Component Bounding Box
        2. 29.2.2. Porting Flash Native Components into Flex
          1. 29.2.2.1. FLVPlayback versus VideoDisplay
          2. 29.2.2.2. Porting the FLVPlayback
          3. 29.2.2.3. Exercise 2: Using the FLVPlayback Component in Flex
          4. 29.2.2.4. Examining the FXFLVPlayback Compilation Process
        3. 29.2.3. Custom States and Transitions in Flex Components
          1. 29.2.3.1. Custom State and Transition Techniques
          2. 29.2.3.2. Exercise 3: Adding Custom States and Transitions
            1. 29.2.3.2.1. Adding Custom States
            2. 29.2.3.2.2. Adding Transitions
          3. 29.2.3.3. Exercise 4: Punkhead and Ticklehead — A Case Study
            1. 29.2.3.3.1. Creating The Punkhead and Ticklehead Animations
            2. 29.2.3.3.2. Adding The Animation States
            3. 29.2.3.3.3. Adding The Transition States
            4. 29.2.3.3.4. Creating Integrated Components
            5. 29.2.3.3.5. Building the Punkhead Flex Application
            6. 29.2.3.3.6. Building the Ticklehead Flex Application
      3. 29.3. Summary
  12. VI. Data Management
    1. 30. Working with Data
      1. 30.1. XML
        1. 30.1.1. Quick XML Primer
        2. 30.1.2. XML and ActionScript: Before E4X
        3. 30.1.3. XML and ActionScript 3.0: Using E4X
          1. 30.1.3.1. Classes of Interest
            1. 30.1.3.1.1. The XML Class
            2. 30.1.3.1.2. The XMLList Class
            3. 30.1.3.1.3. The Namespace Class
            4. 30.1.3.1.4. The QName Class
          2. 30.1.3.2. Accessing XML
            1. 30.1.3.2.1. Using XML Class Methods
            2. 30.1.3.2.2. Using E4X Operators and Expressions
          3. 30.1.3.3. Modifying XML
            1. 30.1.3.3.1. Adding Elements to Your XML Object
            2. 30.1.3.3.2. Modifying Elements in Your XML Object
            3. 30.1.3.3.3. Deleting Elements in Your XML Object
          4. 30.1.3.4. Miscellaneous Debris
      2. 30.2. Collections API
        1. 30.2.1. IList
        2. 30.2.2. ICollectionView
          1. 30.2.2.1. Sorting
          2. 30.2.2.2. Filtering
          3. 30.2.2.3. IViewCursor
        3. 30.2.3. ListCollectionView
          1. 30.2.3.1. ArrayCollection
          2. 30.2.3.2. XMLListCollection
          3. 30.2.3.3. A Source for Binding — dataProvider
          4. 30.2.3.4. Working with CollectionEvent
      3. 30.3. Associative Arrays/Dictionary
        1. 30.3.1. Using Strings as Keys
          1. 30.3.1.1. Dynamic Classes
            1. 30.3.1.1.1. Object
            2. 30.3.1.1.2. Dictionary
        2. 30.3.2. Using Objects as Keys
          1. 30.3.2.1. Not All Equality Is Equal
          2. 30.3.2.2. Iteration
          3. 30.3.2.3. Using Weak Keys
      4. 30.4. Repeaters
        1. 30.4.1. During Execution
        2. 30.4.2. After Execution
        3. 30.4.3. Handling Interaction
        4. 30.4.4. When Not to Use Repeater
      5. 30.5. Summary
    2. 31. Formatters and Validators
      1. 31.1. Overview
      2. 31.2. Formatters
        1. 31.2.1. Using Standard Formatters
          1. 31.2.1.1. ZipCodeFormatter
          2. 31.2.1.2. PhoneFormatter
          3. 31.2.1.3. DateFormatter
          4. 31.2.1.4. NumberFormatter
          5. 31.2.1.5. CurrencyFormatter
        2. 31.2.2. Handling Input Data Errors
      3. 31.3. Validators
        1. 31.3.1. Using Standard Validators
          1. 31.3.1.1. Binding Controls to Validators
          2. 31.3.1.2. Setting Validation Parameters
        2. 31.3.2. Changing the Default Error Messages
        3. 31.3.3. Triggering Validation
          1. 31.3.3.1. Setting Trigger/TriggerEvent
          2. 31.3.3.2. Utilizing Validator.validateAll() to Trigger Multiple Validators
      4. 31.4. Regular Expressions in ActionScript 3
        1. 31.4.1. Common Regular Expression Use Cases
        2. 31.4.2. A Regular Expression Primer
      5. 31.5. RegExpValidator: A Validator's Validator
      6. 31.6. Customizing and Centralizing Formatters and Validators
        1. 31.6.1. Centralizing Formatters
        2. 31.6.2. Centralizing Validators
      7. 31.7. Summary
    3. 32. Using the List Components
      1. 32.1. ListBase Is Everywhere
        1. 32.1.1. ListBase APIs
          1. 32.1.1.1. Selection and Update API
          2. 32.1.1.2. Drag and Drop API
          3. 32.1.1.3. Additional Features
            1. 32.1.1.3.1. Data Tips
            2. 32.1.1.3.2. Icons
            3. 32.1.1.3.3. Labels
            4. 32.1.1.3.4. Item Renderers
      2. 32.2. Working with the List Class
        1. 32.2.1. Item-Editing Functionality in List
        2. 32.2.2. List Descendents
      3. 32.3. The Menu Class
        1. 32.3.1. Creating Menu Objects
        2. 32.3.2. Working with the Menu Class
      4. 32.4. The TileBase Class
        1. 32.4.1. HorizontalList
        2. 32.4.2. TileList
      5. 32.5. List, HorizontalList, and TileList — Optimized Memory Consumption
      6. 32.6. Summary
    4. 33. Advanced Data Controls
      1. 33.1. Overview
      2. 33.2. Tree
        1. 33.2.1. Feeding the Tree
        2. 33.2.2. Changing the Look of the Tree
        3. 33.2.3. Working with the Tree Control
          1. 33.2.3.1. Expanding and Collapsing Branches
          2. 33.2.3.2. Handling Common Tree Events
      3. 33.3. DataGrid
        1. 33.3.1. Populating the DataGrid
        2. 33.3.2. Working with Columns
          1. 33.3.2.1. Introducing <mx:DataGridColumn/>
          2. 33.3.2.2. Interacting with <mx:DataGridColumn/>
        3. 33.3.3. Handling Events
      4. 33.4. Customizing Renderers
        1. 33.4.1. Customizing Cells
          1. 33.4.1.1. Item Renderers
            1. 33.4.1.1.1. Drop-In Item Renderers
            2. 33.4.1.1.2. Inline Item Renderers
            3. 33.4.1.1.3. Custom Component Item Renderers
          2. 33.4.1.2. Item Editors
          3. 33.4.1.3. Ever-Present Item Editors
        2. 33.4.2. Headers
      5. 33.5. AdvancedDataGrid
        1. 33.5.1. Implementing the AdvancedDataGrid
        2. 33.5.2. Grouping Data in the AdvancedDataGrid
          1. 33.5.2.1. Grouping Columns under a Common Header
          2. 33.5.2.2. Grouping Data Logically into Groups
        3. 33.5.3. Hierarchical Data in the AdvancedDataGrid
      6. 33.6. OLAPDataGrid
        1. 33.6.1. An OLAP Primer
        2. 33.6.2. Working with the OLAPDataGrid
          1. 33.6.2.1. Creating an OLAP Schema for Your Data
          2. 33.6.2.2. Creating an OLAP Query for Your Data
          3. 33.6.2.3. Applying Aggregations to Your OLAPDataGrid
      7. 33.7. Summary
    5. 34. Drag and Drop in Flex
      1. 34.1. Overview
      2. 34.2. Working with Drag and Drop-Enabled Components
        1. 34.2.1. Enabling a List for Drag and Drop
        2. 34.2.2. Moving an Item
        3. 34.2.3. Preventing Duplicates
      3. 34.3. Working with Drag and Drop Events
      4. 34.4. Adding Drag and Drop Support to Nonenabled Components
        1. 34.4.1. Setting Up Your Component as a Drag Initiator
        2. 34.4.2. Setting Up Your Component as a Drop Target
      5. 34.5. Additional Drag and Drop Tips
        1. 34.5.1. Custom DragSource Formats
        2. 34.5.2. Custom Drag Proxy
        3. 34.5.3. Maintaining Type Information
      6. 34.6. Summary
    6. 35. Drag and Drop in AIR
      1. 35.1. Overview of AIR Drag and Drop
        1. 35.1.1. The Clipboard
          1. 35.1.1.1. Adding Data to the Clipboard
          2. 35.1.1.2. Reading Data from the Clipboard
          3. 35.1.1.3. Reading and Writing Custom Data from the Clipboard
        2. 35.1.2. The NativeDragManager
          1. 35.1.2.1. The Phases of Drag and Drop
          2. 35.1.2.2. Events Used in Drag-Out Operations
          3. 35.1.2.3. Events Used in Drag-In Operations
      2. 35.2. Dragging Data from an AIR Application
        1. 35.2.1. The Clipboard Data behind an Image
          1. 35.2.1.1. Deferred Data
      3. 35.3. Dragging Files to an AIR Application
      4. 35.4. Summary
    7. 36. Using the Charting Components
      1. 36.1. Understanding Charting
        1. 36.1.1. Assigning Data to a Chart
        2. 36.1.2. Chart Types
          1. 36.1.2.1. Area Charts
          2. 36.1.2.2. Bar Charts
          3. 36.1.2.3. Bubble Charts
          4. 36.1.2.4. Candlestick Charts
          5. 36.1.2.5. Column Charts
          6. 36.1.2.6. HighLowOpenClose (HLOC) Charts
          7. 36.1.2.7. Line Charts
          8. 36.1.2.8. Pie Charts
          9. 36.1.2.9. Plot Charts
        3. 36.1.3. Chart Axes
          1. 36.1.3.1. Axis Types
          2. 36.1.3.2. Customizing Your Axis Label
        4. 36.1.4. Chart Series
          1. 36.1.4.1. Series Types
        5. 36.1.5. Chart Data Tips
        6. 36.1.6. Chart Legends
      2. 36.2. Runtime Chart Interaction
        1. 36.2.1. Handling User Interaction
        2. 36.2.2. Programmatic Interaction
      3. 36.3. Customizing a Chart's Look and Feel
        1. 36.3.1. Custom Renderers
        2. 36.3.2. Styling
        3. 36.3.3. Effects
      4. 36.4. Summary
    8. 37. Resource Bundles and Data Localization
      1. 37.1. Overview
      2. 37.2. L10n Using Properties Files
        1. 37.2.1. Understanding Properties Files
        2. 37.2.2. Dealing with Character Encoding
          1. 37.2.2.1. Eclipse and Character Encoding
          2. 37.2.2.2. Changing the Default Encoding Type for Properties Files in Eclipse
        3. 37.2.3. Setting Up Locales in Your Flex Project
          1. 37.2.3.1. Project Settings
          2. 37.2.3.2. Locale Chains
          3. 37.2.3.3. Using the copylocale.exe Command-Line Tool
      3. 37.3. Implementing i18n in Flex 3
        1. 37.3.1. Utilizing Your Resources
          1. 37.3.1.1. Using @Resource
          2. 37.3.1.2. Using ResourceBundle
          3. 37.3.1.3. Using the Flex 3 ResourceManager
            1. 37.3.1.3.1. Accessing Data Using ResourceManager
            2. 37.3.1.3.2. Switching Locales at Runtime
      4. 37.4. Loading Resources at Runtime
        1. 37.4.1. Resource Modules
        2. 37.4.2. Programmatically Generating ResourceBundle
        3. 37.4.3. Pairing Resources with Modules
      5. 37.5. Globalizing AIR Applications
      6. 37.6. Summary
  13. VII. Client Communications
    1. 38. Browser Communication in Flex
      1. 38.1. Understanding the Web Context
      2. 38.2. Using flashVars to Pass Data into Flex
      3. 38.3. Linking to an External Page URL
      4. 38.4. Interacting with JavaScript
        1. 38.4.1. Invoking JavaScript from Flex
        2. 38.4.2. Invoking ActionScript from JavaScript
        3. 38.4.3. Passing Data Between ActionScript and JavaScript
          1. 38.4.3.1. Parameters
          2. 38.4.3.2. Return Values
          3. 38.4.3.3. Complex Objects
      5. 38.5. Using the Flex-Ajax Bridge
      6. 38.6. Disabling Browser Integration
      7. 38.7. Summary
    2. 39. HTML Mashups with AIR
      1. 39.1. Why Embed HTML in an AIR Application?
      2. 39.2. YouTube Sample
      3. 39.3. Displaying HTML in AIR
        1. 39.3.1. Loading Remote Content
          1. 39.3.1.1. Working with Security Sandboxes
          2. 39.3.1.2. Interacting between Different Sandboxes
        2. 39.3.2. Loading In-Memory Content
        3. 39.3.3. Loading Local File Content
          1. 39.3.3.1. Examining EmbeddedPlayer.html Content
      4. 39.4. Interacting with JavaScript
        1. 39.4.1. Calling Embedded JavaScript from ActionScript
        2. 39.4.2. Calling ActionScript from JavaScript
        3. 39.4.3. Controlling the HTML DOM from ActionScript
      5. 39.5. Summary
    3. 40. Deep Linking
      1. 40.1. Deep Linking on the Web
      2. 40.2. Deep Linking with Flex
        1. 40.2.1. Fragment Identifiers in URLs
      3. 40.3. Flex 3 Support for Deep Linking
        1. 40.3.1. Using the BrowserManager API
          1. 40.3.1.1. Examining the Browser URL
          2. 40.3.1.2. Example #1: The BrowserManager API in Action
          3. 40.3.1.3. Encoding and Decoding URI Components
        2. 40.3.2. Under the Hood: How Flex Deep Linking Works
          1. 40.3.2.1. The Flex Deep-Linking Architecture
          2. 40.3.2.2. Handling Changes in Navigational State
          3. 40.3.2.3. Handling Changes in the Browser's URL
          4. 40.3.2.4. Why history.js Is So Important
      4. 40.4. Real-World Deep Linking: the Space Image Browser
        1. 40.4.1. Example #2: Working with Navigational States
          1. 40.4.1.1. What Is Navigational State?
          2. 40.4.1.2. Encoding Navigational State
          3. 40.4.1.3. A Basic Deep-Linking Architecture
          4. 40.4.1.4. Adjusting the View State
        2. 40.4.2. Example #3: A More Sophisticated Image Browser
          1. 40.4.2.1. A Richer Notion of Navigational State ...
          2. 40.4.2.2. And a Larger Number of Views ...
          3. 40.4.2.3. Require a Richer Deep-Linking Architecture
          4. 40.4.2.4. Adjusting the View State, Version 2
          5. 40.4.2.5. Using HTML Navigation to Change States
      5. 40.5. Search Engine Indexing and Optimization
      6. 40.6. Related Technologies and Tools
        1. 40.6.1. SWFAddress
        2. 40.6.2. UrlKit
        3. 40.6.3. History Manager
      7. 40.7. Summary
    4. 41. System Interactions in Flex
      1. 41.1. Detecting Client System Capabilities
      2. 41.2. Going Full Screen
      3. 41.3. Enabling Right-Click Context Menus
        1. 41.3.1. Adding and Removing Context Menu Options
        2. 41.3.2. Invoking Actions from Context Menus
      4. 41.4. Limitations of System Interactions
        1. 41.4.1. Limitations of Full-Screen Mode
        2. 41.4.2. Limitations of Custom Context Menus
      5. 41.5. Summary
    5. 42. Native Desktop Support with AIR
      1. 42.1. Working with Windows
        1. 42.1.1. Creating a Native Window
          1. 42.1.1.1. Important Properties for Rendering Windows
            1. 42.1.1.1.1. The systemChrome Property
            2. 42.1.1.1.2. The type Property
            3. 42.1.1.1.3. The transparency Property
            4. 42.1.1.1.4. The maximizable, minimizable, resizable Properties
          2. 42.1.1.2. Using the NativeWindow Class
          3. 42.1.1.3. Using the Window Class
        2. 42.1.2. The Native Window Explorer
      2. 42.2. Native Menus
        1. 42.2.1. Context Menus
          1. 42.2.1.1. Native Menu Events
            1. 42.2.1.1.1. NativeFlexMenuEvent Properties
          2. 42.2.1.2. Alternative Ways of Defining Menus
        2. 42.2.2. Windows- and Application-Level Menus
          1. 42.2.2.1. Determining AIR System Capabilities
      3. 42.3. Interacting with the System Tray/Dock
        1. 42.3.1. Sending Notifications
      4. 42.4. Detecting User Presence
      5. 42.5. Monitoring Network Connection
      6. 42.6. AIR Capabilities and the Flash Runtime
      7. 42.7. Enabling Full-Screen Mode
      8. 42.8. Summary
    6. 43. LocalConnection and Shared Objects
      1. 43.1. Overview
      2. 43.2. The LocalConnection Class
        1. 43.2.1. SWF-to-SWF Communication
          1. 43.2.1.1. Working with a LocalConnection Receiver
          2. 43.2.1.2. Working with a LocalConnection Sender
        2. 43.2.2. Crossing Domain Boundaries
          1. 43.2.2.1. Specifying the Connection Name
          2. 43.2.2.2. Allowing Domains
        3. 43.2.3. Working with Data
        4. 43.2.4. Working around the 40KB Limit
        5. 43.2.5. Standard LocalConnection Errors
      3. 43.3. Working with Local Shared Objects
        1. 43.3.1. Creating or Retrieving Local Shared Objects
        2. 43.3.2. Storing Data in Local Shared Objects
        3. 43.3.3. Retrieving Data from Local Shared Objects
        4. 43.3.4. Explicitly Saving Local Shared Objects
        5. 43.3.5. Deleting Properties and Destroying Local Shared Objects
        6. 43.3.6. Additional Information
          1. 43.3.6.1. Flash Player Settings Manager
          2. 43.3.6.2. Directory Locations
            1. 43.3.6.2.1. Operating System Defaults
            2. 43.3.6.2.2. Custom Locations
        7. 43.3.7. Serializing Custom Classes
          1. 43.3.7.1. Using registerClassAlias()
            1. 43.3.7.1.1. Using registerClassAlias() with LocalConnection
            2. 43.3.7.1.2. Using registerClassAlias() with SharedObject
            3. 43.3.7.1.3. Cons of Using registerClassAlias() with LocalConnection
      4. 43.4. Summary
    7. 44. File Management with Flex
      1. 44.1. Overview
        1. 44.1.1. Prerequisites
      2. 44.2. Using the FileReference Class
        1. 44.2.1. Handling FileReference Events
        2. 44.2.2. Uploading Files
          1. 44.2.2.1. Client-Side Code
          2. 44.2.2.2. Server-Side Code
        3. 44.2.3. Downloading Files with FileReference
        4. 44.2.4. Canceling a File Upload or Download
      3. 44.3. Working with Multiple Files
      4. 44.4. Server-Side Considerations
      5. 44.5. Summary
    8. 45. Local File Management with AIR
      1. 45.1. File Operations
        1. 45.1.1. Referencing Directories
        2. 45.1.2. Referencing Files
        3. 45.1.3. Navigating Paths
      2. 45.2. Synchronous versus Asynchronous API
        1. 45.2.1. Copying a File Synchronously
        2. 45.2.2. Copying a File Asynchronously
      3. 45.3. Other File and Directory Operations
        1. 45.3.1. Checking for Existence
        2. 45.3.2. Deleting Files and Directories
        3. 45.3.3. Moving Files and Directories
        4. 45.3.4. Enumerating a Directory
        5. 45.3.5. Creating Temporary Directories and Files
      4. 45.4. Working with Native File Dialogs
        1. 45.4.1. Native Directory Browser
        2. 45.4.2. Native Browse for Open Dialog
        3. 45.4.3. Native Browse for Open Multiple Dialogs
        4. 45.4.4. Native File Save Dialog
      5. 45.5. Reading and Writing File Data
        1. 45.5.1. Saving Bitmap Data as a JPEG File
        2. 45.5.2. Reading XML Data from a File
      6. 45.6. Filesystem Controls
      7. 45.7. Encrypted Local Data
        1. 45.7.1. Writing Data
        2. 45.7.2. Reading Data
        3. 45.7.3. Deleting Data
      8. 45.8. Summary
  14. VIII. Server Integration
    1. 46. Introduction to RPC Services
      1. 46.1. Overview
      2. 46.2. The mx.rpc Libraries
        1. 46.2.1. Differences between MXML and ActionScript Classes
          1. 46.2.1.1. The showBusyCursor Property
          2. 46.2.1.2. The concurrency Property
        2. 46.2.2. Parameter Binding versus Explicit Parameter Passing
      3. 46.3. Working with the HTTPService Component
      4. 46.4. Working with the WebService Component
        1. 46.4.1. Using a WebService in MXML
          1. 46.4.1.1. Converting WSDL Operations to MXML Requests
        2. 46.4.2. Calling a WebService in ActionScript
      5. 46.5. Debugging Remote Service Calls
        1. 46.5.1. Network Packet Sniffing
        2. 46.5.2. Debug Tracing in mx.rpc
          1. 46.5.2.1. Logging an HTTPService Request
          2. 46.5.2.2. Logging a WebService Initialization
          3. 46.5.2.3. Logging a Call to a Web Service Operation
      6. 46.6. Choosing a Protocol and Server Implementation
      7. 46.7. Alternative Server Implementations for AMF
      8. 46.8. Summary
    2. 47. Error Handling
      1. 47.1. Exception Handling with Synchronous Code
        1. 47.1.1. Flash Debug Player versus Release Player
        2. 47.1.2. Try/Catch/Finally
        3. 47.1.3. Exception Bubbling
        4. 47.1.4. Custom Error Types
          1. 47.1.4.1. Throw
          2. 47.1.4.2. Handling Errors in Functions
      2. 47.2. Asynchronous Error Handling with Events
        1. 47.2.1. Important Error Events
        2. 47.2.2. Asynchronous Events in the Debug Player
      3. 47.3. Summary
    3. 48. Flex and Flash Media Server
      1. 48.1. Benefits of Streaming Video with the FMS
        1. 48.1.1. Exercise 1: Playing Video On Demand
          1. 48.1.1.1. Playing an FLV File
          2. 48.1.1.2. Playing an MP4 File
          3. 48.1.1.3. Playing a MP3 File
      2. 48.2. Setting Up Applications and Understanding Instances
      3. 48.3. Developing for the Flash Media Server in Flex
        1. 48.3.1. Exercise 2: Using the Bandwidth Check System of the Flash Media Server
      4. 48.4. Understanding the Netstream with FMS
      5. 48.5. Buffer Control
      6. 48.6. Publishing Video
        1. 48.6.1. Exercise 3: Using the Flash Media Server for Live and Recorded Streams
          1. 48.6.1.1. Setting Up the FMS Application
          2. 48.6.1.2. Streaming a Preexisting Video
          3. 48.6.1.3. Publishing and Recording a Live Stream
      7. 48.7. Data with the Stream
        1. 48.7.1. Exercise 4: Flash Media Server
          1. 48.7.1.1. Adding Data to the FMS Stream
          2. 48.7.1.2. Using the Data as It Arrives in the FMS Stream
      8. 48.8. Summary
    4. 49. RESTful Web Services with Flex and the Zend Framework
      1. 49.1. What Is a RESTful Web Service?
      2. 49.2. The Routes Sample RESTful API
        1. 49.2.1. Setting Up the Server and Development Environment
          1. 49.2.1.1. Server Software Requirements
            1. 49.2.1.1.1. Configuring Apache and MySQL
            2. 49.2.1.1.2. Configuring the Zend Framework
            3. 49.2.1.1.3. Configuring MySQL
        2. 49.2.2. Client Software You Might Need
      3. 49.3. How Zend Works
      4. 49.4. The Flex Sample Application
        1. 49.4.1. Retrieving Data from a RESTful Service
          1. 49.4.1.1. The HTTPService Declaration
          2. 49.4.1.2. Requesting All Routes
            1. 49.4.1.2.1. Working with AsyncToken
            2. 49.4.1.2.2. Managing Client State during Server Requests
          3. 49.4.1.3. Processing the Results
          4. 49.4.1.4. Managing Errors
            1. 49.4.1.4.1. The Fault Handler
            2. 49.4.1.4.2. Server-Side Business Errors
        2. 49.4.2. Creating and Updating Data with a RESTful Service
        3. 49.4.3. Deleting Data from a RESTful Service
      5. 49.5. Summary
    5. 50. Integrating Flex and Java
      1. 50.1. Introduction to the Routes Web Service
      2. 50.2. Setting Up the Server and Development Environment
        1. 50.2.1. Server Software Requirements
          1. 50.2.1.1. Configuring Java, Grails, Groovy, and MySQL
          2. 50.2.1.2. Running the Server
        2. 50.2.2. Client Software You Might Need
      3. 50.3. The Grails Routes Web Service
        1. 50.3.1. Grails Code Supporting the Web Service
          1. 50.3.1.1. The Route.groovy Domain Class
          2. 50.3.1.2. RouteService.Groovy
          3. 50.3.1.3. Web Service Fault Handling
          4. 50.3.1.4. Enabling Flex to Receive SOAP Faults
      4. 50.4. The Flex Sample Application
        1. 50.4.1. The RouteService.as Service Class
        2. 50.4.2. Using IResponder
        3. 50.4.3. Working with Custom Server-Side Errors
          1. 50.4.3.1. Serialization with SchemaTypeManager
          2. 50.4.3.2. Mapping ActionScript types to XML Schema types
          3. 50.4.3.3. Strict Nillability
          4. 50.4.3.4. Calling Web Services from Other Servers
      5. 50.5. Summary
    6. 51. Web Services with .NET and Flex
      1. 51.1. Introduction to the Routes Web Service
      2. 51.2. Setting Up the Server and Development Environment
        1. 51.2.1. Server Software Requirements
          1. 51.2.1.1. Configuring Visual Studio and MySQL
        2. 51.2.2. Client Software You Might Need
      3. 51.3. The .NET Routes Web Service
        1. 51.3.1. .NET Code Supporting the Web Service
          1. 51.3.1.1. The IRouteService Interface
          2. 51.3.1.2. Route DTO versus Route persistence
          3. 51.3.1.3. RouteService.asmx
          4. 51.3.1.4. Web Service Fault Handling
            1. 51.3.1.4.1. Enabling Flex to Receive ASP.NET SoapExceptions
      4. 51.4. The Flex Sample Application
        1. 51.4.1. The Import Web Service (WSDL) Tool
        2. 51.4.2. Accessing the Web Service
          1. 51.4.2.1. Using the Web Service from ActionScript
          2. 51.4.2.2. Using the Web Service from MXML
        3. 51.4.3. Working with Custom Server-Side Errors
          1. 51.4.3.1. Calling Web Services from Other Servers
      5. 51.5. Summary
    7. 52. Offline Data Access with AIR
      1. 52.1. Introduction to SQLite
        1. 52.1.1. SQLite versus XML
      2. 52.2. Synchronous versus Asynchronous
      3. 52.3. Creating a Database
        1. 52.3.1. Opening a Database Asynchronously
        2. 52.3.2. Opening a Database Synchronously
        3. 52.3.3. Working with Data Definition Language
      4. 52.4. Working with Data
        1. 52.4.1. Creating Data
          1. 52.4.1.1. Retrieving the Primary Key Field ID
          2. 52.4.1.2. Why Use Parameters?
            1. 52.4.1.2.1. VALUES ('A Favorite Boston Run', 'Winding route along river', 6.2 )
        2. 52.4.2. Retrieving Data
        3. 52.4.3. Updating Data
        4. 52.4.4. Deleting Data
      5. 52.5. Using Transactions to Import Data
      6. 52.6. Making Online Data Available for Offline Access
        1. 52.6.1. Importing XML into a SQLite Database
          1. 52.6.1.1. Creating a Table Based on XML Data
          2. 52.6.1.2. Inserting XML Data into the Database
        2. 52.6.2. Improving the XML to SQLite Importer
      7. 52.7. Using Third-Party SQLite Database Management Applications
      8. 52.8. Summary
  15. IX. Data Services
    1. 53. Introduction to LCDS
      1. 53.1. Overview of LCDS
        1. 53.1.1. LCDS Resources
      2. 53.2. Understanding LCDS
        1. 53.2.1. Data Service Solutions
        2. 53.2.2. Client Architecture
        3. 53.2.3. Server Architecture
        4. 53.2.4. The Service Types
          1. 53.2.4.1. The Remoting Service
          2. 53.2.4.2. The Proxy Service
          3. 53.2.4.3. The Message Service
          4. 53.2.4.4. The Data Management Service
          5. 53.2.4.5. PDF Generation
        5. 53.2.5. Communication Channels
          1. 53.2.5.1. Choosing the Best Channels
        6. 53.2.6. Action Message Format (AMF)
      3. 53.3. Creating an LCDS Project in Flex Builder
        1. 53.3.1. The New Flex Project Wizard
          1. 53.3.1.1. Stage 1: Name and Server Technology
          2. 53.3.1.2. Stage 2: J2EE Settings
          3. 53.3.1.3. Stage 3: The Build Path
        2. 53.3.2. Configuring the Application Server
          1. 53.3.2.1. Installing the Transaction Manager
      4. 53.4. Troubleshooting
        1. 53.4.1. Logging
          1. 53.4.1.1. Client-Side Logging
          2. 53.4.1.2. Server-Side Logging
        2. 53.4.2. Server-Side Debugging
      5. 53.5. Summary
    2. 54. LCDS and ColdFusion
      1. 54.1. ColdFusion 8 and Integrated LCDS
        1. 54.1.1. LCDS-Specific ColdFusion Installation Screens
          1. 54.1.1.1. Subcomponent Selection Screen
          2. 54.1.1.2. LCDS ES License Acceptance Screen
          3. 54.1.1.3. LCDS ES Serial Number Screen
          4. 54.1.1.4. Complete the Installation
        2. 54.1.2. LCDS-Specific ColdFusion Administrator Screens
          1. 54.1.2.1. Data & Services Flex Integration
          2. 54.1.2.2. Event Gateway Configuration
            1. 54.1.2.2.1. Event Gateways Gateway Types
            2. 54.1.2.2.2. Event Gateways Gateway Instances
      2. 54.2. Event Gateways
        1. 54.2.1. DataServicesMessaging
        2. 54.2.2. DataManagement
      3. 54.3. Data Management
      4. 54.4. Summary
    3. 55. The Message Service
      1. 55.1. Message Service Overview
      2. 55.2. Message Service Technology Explained
        1. 55.2.1. Publish and Subscribe
        2. 55.2.2. Producers and Consumers
        3. 55.2.3. Messages Travel through a Channel
        4. 55.2.4. Pushing Messages from the Server
      3. 55.3. Using the Message Service
        1. 55.3.1. Configuring a Destination on the Server
          1. 55.3.1.1. Enabling Subtopics
          2. 55.3.1.2. Expiring Messages
          3. 55.3.1.3. Message Queue Processing
        2. 55.3.2. Creating Messages on the Client
        3. 55.3.3. Sending Messages
          1. 55.3.3.1. Acknowledgment and Fault Events
        4. 55.3.4. Receiving Messages
          1. 55.3.4.1. Handling Message Events
          2. 55.3.4.2. Extracting Message Data
        5. 55.3.5. Declaring Producers and Consumers in MXML
        6. 55.3.6. Filtering Messages
          1. 55.3.6.1. Filtering by Message Selector
          2. 55.3.6.2. Filtering by Subtopic
        7. 55.3.7. Detecting Connectivity
        8. 55.3.8. Publishing from the Server
          1. 55.3.8.1. Constructing Messages
          2. 55.3.8.2. Routing Messages to a Destination
          3. 55.3.8.3. Pushing Messages to Specific Clients
      4. 55.4. Message Service Applications
        1. 55.4.1. Example 1: Chat Rooms
          1. 55.4.1.1. The Chat Destination
          2. 55.4.1.2. The ChatRoom Class
          3. 55.4.1.3. The Chat Rooms Application
          4. 55.4.1.4. Chat Rooms Summary
        2. 55.4.2. Example 2: Stock Price Ticker
          1. 55.4.2.1. The Java Stock Feed
          2. 55.4.2.2. The Stock Feed Destination
          3. 55.4.2.3. The Flex Prices Model
          4. 55.4.2.4. The Stock Price Ticker Application
          5. 55.4.2.5. Stock Prices Summary
        3. 55.4.3. Example 3: Generating a PDF
          1. 55.4.3.1. PDF Generation Overview
          2. 55.4.3.2. Preparing the Project
          3. 55.4.3.3. Configuring the JMS Queue
          4. 55.4.3.4. Configuring the Message Service Destination
          5. 55.4.3.5. Defining the Resource References
          6. 55.4.3.6. Creating the PDF Generator
          7. 55.4.3.7. Creating the JMS Queue Listener
          8. 55.4.3.8. Create the Flex PDF Generation Client
          9. 55.4.3.9. PDF Generation Summary
      5. 55.5. Summary
    4. 56. The Data Management Service
      1. 56.1. Overview of the DMS
      2. 56.2. Why Use the DMS?
        1. 56.2.1. All about Domain Modeling
        2. 56.2.2. Create, Read, Update, Delete
        3. 56.2.3. Sharing Data Among Users
        4. 56.2.4. Paging Large Data Sets
        5. 56.2.5. Occasional Connectivity
      3. 56.3. Seeing Is Believing: The Six-Line Demo
        1. 56.3.1. Line 1: Declaring a Data Service
        2. 56.3.2. Line 2: Declaring a Collection for the Managed Data
        3. 56.3.3. Line 3: Providing Managed Data to a Data Grid
        4. 56.3.4. Line 4: Filling the Collection
        5. 56.3.5. Line 5: Committing Changes and Synchronizing Clients
        6. 56.3.6. Line 6: Reverting Changes
        7. 56.3.7. Behind the Scenes
      4. 56.4. DMS Technology Explained
        1. 56.4.1. Client and Server Components
        2. 56.4.2. Managed Data
        3. 56.4.3. Managed Relationships
        4. 56.4.4. Client Programming
        5. 56.4.5. Server Integration
          1. 56.4.5.1. DMS Adapters
          2. 56.4.5.2. DMS Assemblers
        6. 56.4.6. Client and Server Collaboration
      5. 56.5. Example Application: DMS Fleet Tracker
        1. 56.5.1. Domain Modeling
          1. 56.5.1.1. The Vehicle Class
          2. 56.5.1.2. The Parcel Class
        2. 56.5.2. DMS Configuration
          1. 56.5.2.1. The Vehicle Destination
          2. 56.5.2.2. The Parcel Destination
        3. 56.5.3. Custom Assemblers
          1. 56.5.3.1. The Vehicle Assembler
          2. 56.5.3.2. The Parcel Assembler
        4. 56.5.4. Client Coding
          1. 56.5.4.1. Filling Collections with Vehicles and Parcels
          2. 56.5.4.2. Visualizing the Vehicle Movements
          3. 56.5.4.3. Filtering the Parcel List
          4. 56.5.4.4. Creating a New Parcel
        5. 56.5.5. Further Considerations
      6. 56.6. Summary
    5. 57. Advanced Data Management Services
      1. 57.1. Overview of DMS
      2. 57.2. Summary-to-Details Modeling
        1. 57.2.1. Replace Lazy Relationship with Get Item
      3. 57.3. Overcoming Item-Pending Errors
        1. 57.3.1. Repeated Attacks
      4. 57.4. Managing Shared and User-Specific Data
        1. 57.4.1. A Simple Instant Messaging System
        2. 57.4.2. Creating a New MessageDetails Item
        3. 57.4.3. Creating and Delivering the User Messages
        4. 57.4.4. Streaming AMF to an NIO End Point
      5. 57.5. Learning More
      6. 57.6. Summary
    6. 58. The Data Services Stress Testing Framework
      1. 58.1. Overview
      2. 58.2. Stress Testing a Data Management Service Application
        1. 58.2.1. Prerequisites
        2. 58.2.2. Writing the Test Application
          1. 58.2.2.1. Starting the Test Scenario
          2. 58.2.2.2. Counting Success and Failure
          3. 58.2.2.3. Stopping the Test
        3. 58.2.3. Configuring the Server
          1. 58.2.3.1. Adding the Separate End Point
          2. 58.2.3.2. Adding the DMS Destination for Result Data
          3. 58.2.3.3. Adding the Remote Object for Logging
          4. 58.2.3.4. Configuring the Default Proxy Service
        4. 58.2.4. Configuring and Starting the Browser Servers
        5. 58.2.5. Compiling the Test Administrator
        6. 58.2.6. Running the Stress Test
      3. 58.3. Further Topics
        1. 58.3.1. Parameterizing Test Applications
        2. 58.3.2. Preconfiguring the Test Administrator
        3. 58.3.3. Creating Customized Test Reports
      4. 58.4. Summary
    7. 59. Using BlazeDS
      1. 59.1. Overview
      2. 59.2. BlazeDS Features
        1. 59.2.1. Services and Client Components
        2. 59.2.2. Channels of Communication
        3. 59.2.3. Integration Points
      3. 59.3. Developing a BlazeDS Project
        1. 59.3.1. Installing the BlazeDS Turnkey
        2. 59.3.2. Creating a Combined Flex/Java Project
          1. 59.3.2.1. Deploying the Project to Tomcat
          2. 59.3.2.2. Enabling Client- and Server-Side Logging
        3. 59.3.3. Using a Remote Object
          1. 59.3.3.1. Creating a RemoteObject Instance
          2. 59.3.3.2. Invoking a Remote Method
          3. 59.3.3.3. Handling the Results of a Remote Method Call
          4. 59.3.3.4. Handling a Fault Generated by a Remote Method Call
          5. 59.3.3.5. Configuring the Remoting Service
          6. 59.3.3.6. Coding the Remote Java Object
          7. 59.3.3.7. Object Mapping
        4. 59.3.4. HTTP and Web Services
          1. 59.3.4.1. Configuring a Proxy Service Destination
          2. 59.3.4.2. Connecting a Flex Client via the Proxy Service
          3. 59.3.4.3. Requesting Data
      4. 59.4. Summary
  16. X. Using Cairngorm
    1. 60. MVC Frameworks
      1. 60.1. What Is MVC?
      2. 60.2. MVC Components
        1. 60.2.1. Understanding the Data Model
        2. 60.2.2. Understanding the View
        3. 60.2.3. Understanding the Controller
        4. 60.2.4. Putting the Pieces Together
      3. 60.3. Why MVC?
        1. 60.3.1. Abstraction
        2. 60.3.2. Component Reuse
        3. 60.3.3. Distributed Development
        4. 60.3.4. Maintenance
        5. 60.3.5. Is There a Definitive MVC?
      4. 60.4. An MVC Approach to Component Architecture
      5. 60.5. Summary
    2. 61. Introduction to Cairngorm
      1. 61.1. Overview
      2. 61.2. The Steps of a Cairngorm Interaction
        1. 61.2.1. The User Gestures
        2. 61.2.2. An Event Is Dispatched
        3. 61.2.3. A Command Executes
        4. 61.2.4. A Business Function Is Delegated
        5. 61.2.5. A Service Is Located and Invoked
        6. 61.2.6. The Model Is Located and Updated
        7. 61.2.7. The View Reflects the Changes
      3. 61.3. Summary
    3. 62. Applied Cairngorm
      1. 62.1. Getting Started
      2. 62.2. The Main Players
        1. 62.2.1. Model Locator
          1. 62.2.1.1. Single Point of Access
          2. 62.2.1.2. Self-Documenting Code
          3. 62.2.1.3. Modeling the Application
          4. 62.2.1.4. Binding the View to the Model
            1. 62.2.1.4.1. Controlling View Navigation
          5. 62.2.1.5. Minimizing Dependencies
            1. 62.2.1.5.1. Favor Dependency Injection over Singleton Access
        2. 62.2.2. Front Controller
          1. 62.2.2.1. Inside the Front Controller
          2. 62.2.2.2. The ShopController
          3. 62.2.2.3. Declaring the Front Controller
        3. 62.2.3. Cairngorm Events
          1. 62.2.3.1. Event Classes
          2. 62.2.3.2. Event Types
          3. 62.2.3.3. Events as Parameter Objects
          4. 62.2.3.4. Self-Dispatching Events
        4. 62.2.4. Cairngorm Commands
          1. 62.2.4.1. Command Execution
            1. 62.2.4.1.1. Synchronous Commands
            2. 62.2.4.1.2. Asynchronous Commands
        5. 62.2.5. Business Delegates
          1. 62.2.5.1. Using a Business Delegate in a Command
          2. 62.2.5.2. Creating a Business Delegate
          3. 62.2.5.3. Stubbing the Service Layer
        6. 62.2.6. Service Locator
          1. 62.2.6.1. Creating a Service Locator
          2. 62.2.6.2. Locating a Service
          3. 62.2.6.3. What about REST?
        7. 62.2.7. Value Objects
          1. 62.2.7.1. Creating a Value Object
          2. 62.2.7.2. Receiving Value Objects
          3. 62.2.7.3. Sending Value Objects
      3. 62.3. Summary
    4. 63. Advanced Cairngorm
      1. 63.1. The Presentation Model Pattern
        1. 63.1.1. Using Cairngorm with Presentation Models
        2. 63.1.2. Sample Cairngorm Presentation Model Application
          1. 63.1.2.1. Nothing to Break
          2. 63.1.2.2. Models Dispatch Cairngorm Events
          3. 63.1.2.3. Command Callbacks
        3. 63.1.3. Domain Models
        4. 63.1.4. Taking Things Further
      2. 63.2. Organizing Cairngorm Projects
        1. 63.2.1. Small Cairngorm Projects
        2. 63.2.2. Large Cairngorm Projects
      3. 63.3. Cairngorm Anti-Patterns
        1. 63.3.1. The Fat Controller
          1. 63.3.1.1. Bad Practice
          2. 63.3.1.2. Good Practice
        2. 63.3.2. Model Locator Landfill
          1. 63.3.2.1. Bad Practice
          2. 63.3.2.2. Good Practice
        3. 63.3.3. Chains of Dependency
          1. 63.3.3.1. Bad Practice
          2. 63.3.3.2. Good Practice
      4. 63.4. Customizing Cairngorm
        1. 63.4.1. Logging Cairngorm Events and Commands
        2. 63.4.2. Timing Asynchronous Commands
        3. 63.4.3. Injecting Dependencies into Commands
          1. 63.4.3.1. Manual Injection
          2. 63.4.3.2. Framework Injection
        4. 63.4.4. Stubbing the Service Layer
          1. 63.4.4.1. Stubbing the Command, Business Delegate, or Service Locator
            1. 63.4.4.1.1. Further Considerations
        5. 63.4.5. Decentralized Controllers
        6. 63.4.6. Disposable Controller
      5. 63.5. Summary
  17. XI. Application Development Strategies
    1. 64. Best Practices
      1. 64.1. Coding Standards
        1. 64.1.1. Consistency
        2. 64.1.2. Clarity
        3. 64.1.3. Cleanliness
          1. 64.1.3.1. Naming Conventions
          2. 64.1.3.2. Namespaces
          3. 64.1.3.3. Classes
          4. 64.1.3.4. Variables and Functions
          5. 64.1.3.5. Code Syntax
            1. 64.1.3.5.1. Proper Indentation
            2. 64.1.3.5.2. Ternary Operators
            3. 64.1.3.5.3. Constant and Static Members
            4. 64.1.3.5.4. Typed versus Dynamic Objects
            5. 64.1.3.5.5. Dictionaries and Associative Arrays
      2. 64.2. Object-Oriented Principles
        1. 64.2.1. Encapsulation
        2. 64.2.2. When to Use Public/Private/Protected/Final Functions
          1. 64.2.2.1. Public Functions
          2. 64.2.2.2. Private Functions
          3. 64.2.2.3. Protected Functions
          4. 64.2.2.4. Internal Functions
        3. 64.2.3. Inheritance
          1. 64.2.3.1. Overriding Functions
          2. 64.2.3.2. When to Use Getter and Setter Methods
            1. 64.2.3.2.1. Public Variables versus Getters/Setters
          3. 64.2.3.3. Polymorphism and Interfaces
        4. 64.2.4. Code Behind
      3. 64.3. Summary
    2. 65. The Security Model
      1. 65.1. Understanding the Security Sandbox
        1. 65.1.1. Understanding the Security Sandbox
        2. 65.1.2. What Is crossdomain.xml?
          1. 65.1.2.1. allow-access-from
          2. 65.1.2.2. allow-http-request-headers-from
          3. 65.1.2.3. site-control and Meta-Policies
        3. 65.1.3. Local Sandboxes
          1. 65.1.3.1. local-with-filesystem
          2. 65.1.3.2. local-with-networking
          3. 65.1.3.3. local-trusted
      2. 65.2. Summary
    3. 66. Modular Application Development
      1. 66.1. Overview
      2. 66.2. Why Modular Development?
      3. 66.3. Building Components
      4. 66.4. Runtime Shared Libraries
      5. 66.5. Using the Module and ModuleLoader Classes
        1. 66.5.1. Cross-Module Communication
        2. 66.5.2. Cross-Module Data Access
      6. 66.6. Summary
    4. 67. Application Performance Strategies
      1. 67.1. Understanding Object Creation Policies
      2. 67.2. Structuring Data for Performance
        1. 67.2.1. Lazy Loading Data
        2. 67.2.2. Impacts of Multiple Service Invocations
      3. 67.3. Managing Event Listeners and Data Bindings
        1. 67.3.1. Collection Events
        2. 67.3.2. Cleaning Up Unused Event Listeners
        3. 67.3.3. Weak Referenced Event Listeners
        4. 67.3.4. Cleaning Up Event Listeners Manually
      4. 67.4. Associative Arrays and Dictionaries
      5. 67.5. Working with Graphics
        1. 67.5.1. Frame Rates
        2. 67.5.2. Using Bitmap Caching
        3. 67.5.3. Managing External SWF Content
        4. 67.5.4. Object Caching and Recycling
      6. 67.6. Summary
    5. 68. Project Documenting with ASDoc
      1. 68.1. What Is ASDoc?
      2. 68.2. Using ASDoc
      3. 68.3. ASDoc Comments and Formatting
        1. 68.3.1. ASDoc Tags
          1. 68.3.1.1. @return
          2. 68.3.1.2. @param
          3. 68.3.1.3. @see
          4. 68.3.1.4. @private
        2. 68.3.2. Classes
        3. 68.3.3. Functions
        4. 68.3.4. Properties
        5. 68.3.5. Getters and Setters
        6. 68.3.6. Metadata
        7. 68.3.7. Formatting with HTML
        8. 68.3.8. Referencing Outside Elements
        9. 68.3.9. Excluding Classes from Generated Output
        10. 68.3.10. Applying Custom Templates
      4. 68.4. Summary
    6. 69. Desktop Deployment with AIR
      1. 69.1. Code Signing and Certificates
        1. 69.1.1. Acquiring a Certificate
          1. 69.1.1.1. Purchasing a Certificate from Thawte
          2. 69.1.1.2. Exporting the Thawte Certificate from Firefox
        2. 69.1.2. Creating and Signing an AIR Package in Flex Builder
        3. 69.1.3. Code Signing with a Developer Certificate
      2. 69.2. Packaging and Signing AIR Applications with the Command Line
      3. 69.3. Distributing AIR Applications
        1. 69.3.1. Web Page Badge Installation
        2. 69.3.2. Using the Web Badge SDK
          1. 69.3.2.1. Customizing the Installation
          2. 69.3.2.2. Launching Installed Applications from a Web Page
        3. 69.3.3. Silent Installations
      4. 69.4. Updating AIR Applications
      5. 69.5. Summary
    7. 70. Dual Deployment for Flex and AIR
      1. 70.1. Coding by Interface
        1. 70.1.1. Pros
        2. 70.1.2. Cons
        3. 70.1.3. Setting Up the Flex Builder Projects
        4. 70.1.4. Referencing the MainAppEntryPoint Component
        5. 70.1.5. Working with the IApplicationPersistence Interface
        6. 70.1.6. Working with the ApplicationPersistenceFactory
      2. 70.2. Using Conditional Compilation
        1. 70.2.1. Pros
        2. 70.2.2. Cons
        3. 70.2.3. Overview of the Conditional Compilation Approach
        4. 70.2.4. Looking at the ApplicationPersistence File
        5. 70.2.5. Configuring the Flex Compiler
      3. 70.3. Summary
  18. XII. Testing and Debugging
    1. 71. Debugging Flex Applications
      1. 71.1. Overview
      2. 71.2. Flash Debug Player
      3. 71.3. The Flex Builder Debugging Perspective
        1. 71.3.1. Placing Breakpoints
          1. 71.3.1.1. Breakpoints in MXML
          2. 71.3.1.2. Conditional and Counting Breakpoints
          3. 71.3.1.3. Managing Breakpoints at Runtime
        2. 71.3.2. Launching an Application in Debug Mode
        3. 71.3.3. Stepping through Code
          1. 71.3.3.1. Step In (F5)
          2. 71.3.3.2. Step Over (F6)
          3. 71.3.3.3. Step Return (F7)
        4. 71.3.4. Examining Application State
          1. 71.3.4.1. The Variables View
            1. 71.3.4.1.1. The Find Dialog
            2. 71.3.4.1.2. The Variables Menu and Other Options
          2. 71.3.4.2. The Expressions View
            1. 71.3.4.2.1. Adding and Editing a Watch Expression
      4. 71.4. The Command-Line Debugger
      5. 71.5. Additional Debugging Techniques
        1. 71.5.1. Debugging Java Server-Side Code
          1. 71.5.1.1. The Java Debug Perspective
          2. 71.5.1.2. The Servers View
          3. 71.5.1.3. The Process of Debugging Server-Side Code
        2. 71.5.2. Monitoring Internet Traffic
          1. 71.5.2.1. Using Charles to View AMF Message Details
        3. 71.5.3. Application-Specific Debugging
        4. 71.5.4. Making the Most of Logging
          1. 71.5.4.1. Logging Objects
        5. 71.5.5. Debugging Bindings
          1. 71.5.5.1. The BindingManager Class
          2. 71.5.5.2. The Observe and ObserveValue Tags
        6. 71.5.6. Adobe Public Bug Database and Issue Reporting System
          1. 71.5.6.1. Registering and Logging In
          2. 71.5.6.2. Before Reporting a Bug
          3. 71.5.6.3. Creating a Good Bug Report
            1. 71.5.6.3.1. Example Bug Report: Transition Flashes the Target State before Executing
          4. 71.5.6.4. Watching a Bug Report
      6. 71.6. Summary
    2. 72. Using the Flex Profiler
      1. 72.1. Overview
      2. 72.2. Before You Get Started
      3. 72.3. Profiling Basics
        1. 72.3.1. Performance Profiling and Optimization Best Practices
        2. 72.3.2. Memory Profiling Basics
        3. 72.3.3. Performance Profiling Basics
        4. 72.3.4. Sampling Profiler Basics
      4. 72.4. Flex Builder 3 Profiling
        1. 72.4.1. The Profiling Perspective
        2. 72.4.2. Launching the Profiler
          1. 72.4.2.1. Launching from the Project
          2. 72.4.2.2. Launching from the Run Menu
          3. 72.4.2.3. Launching from Keyboard Shortcuts
          4. 72.4.2.4. Launching from the Flex Builder toolbar
          5. 72.4.2.5. Launching External Applications
        3. 72.4.3. Using the Memory Profiler
          1. 72.4.3.1. The Memory Usage Graph
          2. 72.4.3.2. Viewing Live Objects
          3. 72.4.3.3. Taking Memory Snapshots
          4. 72.4.3.4. Examining Object References
          5. 72.4.3.5. Inspecting the Cause of an Object Instantiation
          6. 72.4.3.6. Views That Require Two Memory Snapshots
        4. 72.4.4. Using the Performance Profiler
          1. 72.4.4.1. Taking a Performance Snapshot
          2. 72.4.4.2. Viewing Method Statistics
          3. 72.4.4.3. Clearing Accumulated Performance Data
        5. 72.4.5. Filtering in the Profiler
        6. 72.4.6. Saving and Loading Profiling Data
        7. 72.4.7. Other Useful Features
          1. 72.4.7.1. Profiler Preferences
          2. 72.4.7.2. Running Garbage Collection Manually
          3. 72.4.7.3. Viewing Zero Time Methods
          4. 72.4.7.4. Viewing Source Code
          5. 72.4.7.5. Navigating between Views
      5. 72.5. The Profilers in Action
        1. 72.5.1. Using the Memory Profiler to Detect Leaks
        2. 72.5.2. Using the Performance Profiler to Optimize an Algorithm
      6. 72.6. Creating Your Own Profiler
      7. 72.7. Summary
    3. 73. Unit Testing and Test-Driven Development with FlexUnit
      1. 73.1. Overview
      2. 73.2. Why Write Tests?
        1. 73.2.1. Preventing Bugs in the First Place
        2. 73.2.2. Gaining the Confidence to Refactor
        3. 73.2.3. Driving Improvements in Design
        4. 73.2.4. Writing Testable Software
        5. 73.2.5. Happy Developers and Effortless Documentation
      3. 73.3. Technology and Terminology
        1. 73.3.1. The FlexUnit Library
        2. 73.3.2. Unit Tests, Test Cases, and Test Suites
        3. 73.3.3. Running Tests
      4. 73.4. Test-Driven Development by Example
        1. 73.4.1. Preparing for Unit Testing
          1. 73.4.1.1. Download FlexUnit
          2. 73.4.1.2. Adding the Library
          3. 73.4.1.3. Creating the Test Folder
        2. 73.4.2. Creating a Test Case
        3. 73.4.3. Assembling a Test Suite
        4. 73.4.4. Failing the Test!
        5. 73.4.5. Prepare, Invoke, Assert
          1. 73.4.5.1. Assertion Functions
          2. 73.4.5.2. Examining Actual Values
          3. 73.4.5.3. Failure Messages
          4. 73.4.5.4. Fleshing Out the Test Case
          5. 73.4.5.5. Some Real Coding
        6. 73.4.6. Happy and Unhappy Paths
          1. 73.4.6.1. Strengthening the Tests
          2. 73.4.6.2. Strengthening the Code
          3. 73.4.6.3. Enough Is Enough
          4. 73.4.6.4. The Virtuous Cycle
        7. 73.4.7. Setting Up and Tearing Down
        8. 73.4.8. White Belt in Testing
      5. 73.5. Further Topics
        1. 73.5.1. Organizing Test Suites
        2. 73.5.2. Removing Dependencies with Mock Objects
          1. 73.5.2.1. The Collaborating Class
          2. 73.5.2.2. The Delegate Interface
          3. 73.5.2.3. The Real and Mock Implementations
          4. 73.5.2.4. Unit Testing with the Mock Delegate
          5. 73.5.2.5. Don't Make a Mockery of Your Unit Tests
        3. 73.5.3. Continuous Integration with Ant and Maven
        4. 73.5.4. Eventful Test Cases
        5. 73.5.5. Test Coverage
        6. 73.5.6. Behavior-Driven Development
      6. 73.6. Summary
    4. 74. The Logging Framework
      1. 74.1. Overview
      2. 74.2. Using the Logging Framework
        1. 74.2.1. Creating a Logging Target
        2. 74.2.2. Getting the Right Logger
        3. 74.2.3. Logging at Different Levels
        4. 74.2.4. Filtering Log Statements
        5. 74.2.5. Log Only When Necessary
      3. 74.3. Customizing the Logging Framework
        1. 74.3.1. Implementing a Remote Logging Target
        2. 74.3.2. Implementing the Java Remote Logger
        3. 74.3.3. Creating a Client that Logs Remotely
      4. 74.4. Further Topics
        1. 74.4.1. Embedded Log Viewer
        2. 74.4.2. Stopwatch Logging
        3. 74.4.3. Logging to Firebug with ThunderBolt
        4. 74.4.4. Removing Logging from Production Code
          1. 74.4.4.1. Removing Logging and Trace Using Ant
      5. 74.5. Summary
    5. 75. The Automation Framework
      1. 75.1. Overview
      2. 75.2. The Technology Explained
        1. 75.2.1. Recording and Playback
        2. 75.2.2. The Automation Libraries
        3. 75.2.3. Runtime or Compile-Time Automation
        4. 75.2.4. Component Identification
      3. 75.3. Automating a Simple Application
        1. 75.3.1. Installing an Automation Tool
        2. 75.3.2. Creating a Testable Application
        3. 75.3.3. Compiling for Automation
        4. 75.3.4. Recording a Test Script
          1. 75.3.4.1. Creating an RIATest Project
          2. 75.3.4.2. Creating a Test Script
          3. 75.3.4.3. Starting Recording
          4. 75.3.4.4. Recording Checkpoints and Interactions
          5. 75.3.4.5. Stopping Recording
        5. 75.3.5. Replaying a Test Script
      4. 75.4. Further Topics
        1. 75.4.1. Automating Custom Components
        2. 75.4.2. Creating a Custom Agent
      5. 75.5. Summary
    6. A. ActionScript Language Comparison
      1. A.1. Runtime Environment Concerns
        1. A.1.1. Compilation
        2. A.1.2. Runtime Engines
        3. A.1.3. Memory Management
          1. A.1.3.1. Automatic versus Explicit
          2. A.1.3.2. The Delete Keyword
        4. A.1.4. Block-Level Scoping
        5. A.1.5. The Notion of Global Variables
        6. A.1.6. Using Console Output
      2. A.2. Language Differences
        1. A.2.1. Working with Data Types
          1. A.2.1.1. Simple Types
          2. A.2.1.2. Complex Types
          3. A.2.1.3. Constants
          4. A.2.1.4. Undeclared
          5. A.2.1.5. Enumeration
          6. A.2.1.6. The Object Data Type
            1. A.2.1.6.1. Runtime Type Checking
            2. A.2.1.6.2. Object Equality
        2. A.2.2. Type Casting
        3. A.2.3. Declarations
        4. A.2.4. Statement Termination
        5. A.2.5. Regular Expressions
      3. A.3. OOP Differences
        1. A.3.1. Classes, Filenames, and Packages
        2. A.3.2. Polymorphism
          1. A.3.2.1. Method Polymorphism
          2. A.3.2.2. Abstract Classes and Interfaces
        3. A.3.3. Inheritance
        4. A.3.4. Access Modifiers
        5. A.3.5. Dynamic Classes
      4. A.4. Summary