Cover image for ActionScript 3.0 Cookbook

Book description

Well before Ajax and Microsoft's Windows Presentation Foundation hit the scene, Macromedia offered the first method for building web pages with the responsiveness and functionality of desktop programs with its Flash-based "Rich Internet Applications". Now, new owner Adobe is taking Flash and its powerful capabilities beyond the Web and making it a full-fledged development environment.

Rather than focus on theory, the ActionScript 3.0 Cookbook concentrates on the practical application of ActionScript, with more than 300 solutions you can use to solve a wide range of common coding dilemmas. You'll find recipes that show you how to:

  • Detect the user's Flash Player version or their operating system

  • Build custom classes

  • Format dates and currency types

  • Work with strings

  • Build user interface components

  • Work with audio and video

  • Make remote procedure calls using Flash Remoting and web services

  • Load, send, and search XML data

  • And much, much more ...

Each code recipe presents the Problem, Solution, and Discussion of how you can use it in other ways or personalize it for your own needs, and why it works. You can quickly locate the recipe that most closely matches your situation and get the solution without reading the whole book to understand the underlying code. Solutions progress from short recipes for small problems to more complex scripts for thornier riddles, and the discussions offer a deeper analysis for resolving similar issues in the future, along with possible design choices and ramifications. You'll even learn how to link modular ActionScript pieces together to create rock-solid solutions for Flex 2 and Flash applications.

When you're not sure how ActionScript 3.0 works or how to approach a specific programming dilemma, you can simply pick up the book, flip to the relevant recipe(s), and quickly find the solution you're looking for.

Adobe Developer Library is a co-publishing partnership between O'Reilly Media and Adobe Systems, Inc. and is designed to produce the number one information resources for developers who use Adobe technologies. Created in 2006, the Adobe Developer Library is the official source for comprehensive learning solutions to help developers create expressive and interactive web applications that can reach virtually anyone on any platform. With top-notch books and innovative online resources covering the latest in rich Internet application development, the Adobe Developer Library offers expert training and in-depth resources, straight from the source.

Table of Contents

  1. ActionScript 3.0 Cookbook
    1. SPECIAL OFFER: Upgrade this ebook with O’Reilly
    2. A Note Regarding Supplemental Files
    3. Preface
      1. What’s Not in This Book
      2. Compatibility
      3. Flash Platform Naming Conventions
      4. The Code
      5. Audience for This Book
        1. What You’ll Need to Know
        2. Who This Book Is For
        3. Who This Book Isn’t For
      6. How This Book Is Organized
      7. How to Use This Book
      8. Conventions Used in This Book
      9. Using Code Examples
      10. O’Reilly Cookbooks
      11. Safari® Enabled
      12. How to Contact Us
      13. About the Tech Reviewers
      14. Acknowledgments
        1. Joey Lott
        2. Darron Schall
        3. Keith Peters
    4. 1. ActionScript Basics
      1. Introduction
      2. Creating an ActionScript Project
        1. Problem
        2. Solution
        3. Discussion
      3. Customizing the Properties of an Application
        1. Problem
        2. Solution
        3. Discussion
      4. Where to Place ActionScript Code
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. How to Trace a Message
        1. Problem
        2. Solution
        3. Discussion
      6. Handling Events
        1. Problem
        2. Solution
        3. Discussion
      7. Responding to Mouse and Key Events
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. Using Mathematical Operators
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      9. Checking Equality or Comparing Values
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      10. Performing Actions Conditionally
        1. Problem
        2. Solution
        3. Discussion
      11. Performing Complex Conditional Testing
        1. Problem
        2. Solution
        3. Discussion
      12. Repeating an Operation Many Times
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      13. Repeating a Task over Time
        1. Problem
        2. Solution
        3. Discussion
      14. Creating Reusable Code
        1. Problem
        2. Solution
        3. Discussion
      15. Generalizing a Method to Enhance Reusability
        1. Problem
        2. Solution
        3. Discussion
      16. Exiting a Method
        1. Problem
        2. Solution
        3. Discussion
      17. Obtaining the Result of a Method
        1. Problem
        2. Solution
        3. Discussion
      18. Handling Errors
        1. Problem
        2. Solution
        3. Description
    5. 2. Custom Classes
      1. Introduction
      2. Creating a Custom Class
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. Determining Where to Save a Class
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. Creating Properties That Behave As Methods
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. Creating Static Methods and Properties
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. Creating Subclasses
        1. Problem
        2. Solution
        3. Discussion
      7. Implementing Subclass Versions of Superclass Methods
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. Creating Constants
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      9. Dispatching Events
        1. Problem
        2. Solution
        3. Discussion
    6. 3. Runtime Environment
      1. Introduction
      2. Detecting the Player Version
        1. Problem
        2. Solution
        3. Discussion
      3. Detecting the Operating System
        1. Problem
        2. Solution
        3. Discussion
      4. Checking the Player Type
        1. Problem
        2. Solution
        3. Discussion
      5. Checking the System Language
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. Detecting Display Settings
        1. Problem
        2. Solution
        3. Discussion
      7. Scaling the Movie
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. Changing the Alignment
        1. Problem
        2. Solution
        3. Discussion
      9. Hiding the Flash Player’s Menu Items
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      10. Detecting the Device’s Audio Capabilities
        1. Problem
        2. Solution
        3. Discussion
      11. Detecting the Device’s Video Capabilities
        1. Problem
        2. Solution
        3. Discussion
      12. Prompting the User to Change Player Settings
        1. Problem
        2. Solution
        3. Discussion
      13. Dealing with System Security
        1. Problem
        2. Solution
        3. Discussion
    7. 4. Numbers and Math
      1. Introduction
      2. Representing Numbers in Different Bases
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. Converting Between Different Number Systems
        1. Problem
        2. Solution
        3. Discussion
      4. Rounding Numbers
        1. Problem
        2. Solution
        3. Discussion
      5. Inserting Leading or Trailing Zeros or Spaces
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. Formatting Numbers for Display Without a Mask
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      7. Formatting Currency Amounts
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. Generating a Random Number
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      9. Simulating a Coin Toss
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      10. Simulating Dice
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      11. Simulating Playing Cards
        1. Problem
        2. Solution
        3. Discussion
      12. Generating a Unique Number
        1. Problem
        2. Solution
        3. Discussion
      13. Converting Angle Measurements
        1. Problem
        2. Solution
        3. Discussion
      14. Calculating the Distance Between Two Points
        1. Problem
        2. Solution
        3. Discussion
      15. Determining Points Along a Circle
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      16. Converting Between Units of Measurement
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    8. 5. Arrays
      1. Introduction
      2. Adding Elements to the Start or End of an Array
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. Looping Through an Array
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. Searching for Matching Elements in an Array
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. Removing Elements
        1. Problem
        2. Solution
        3. Discussion
      6. Inserting Elements in the Middle of an Array
        1. Problem
        2. Solution
        3. Discussion
      7. Converting a String to an Array
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. Converting an Array to a String
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      9. Creating a Separate Copy of an Array
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      10. Storing Complex or Multidimensional Data
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      11. Sorting or Reversing an Array
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      12. Implementing a Custom Sort
        1. Problem
        2. Solution
        3. Discussion
      13. Randomizing the Elements of an Array
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      14. Getting the Minimum or Maximum Element
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      15. Comparing Arrays
        1. Problem
        2. Solution
        3. Discussion
      16. Creating an Associative Array
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      17. Reading Elements of an Associative Array
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    9. 6. Display List
      1. Introduction
      2. Adding an Item to the Display List
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. Removing an Item from the Display List
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. Moving Objects Forward and Backward
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. Creating Custom Visual Classes
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. Creating Simple Buttons
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      7. Loading External Images at Runtime
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. Loading and Interacting with External Movies
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      9. Creating Mouse Interactions
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      10. Dragging and Dropping Objects with the Mouse
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    10. 7. Drawing and Masking
      1. Introduction
      2. Setting a Line Style
        1. Problem
        2. Solution
        3. Discussion
      3. Setting Gradient Line Styles
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. Drawing a Line
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. Drawing a Curve
        1. Problem
        2. Solution
        3. Discussion
      6. Drawing an Arc
        1. Problem
        2. Solution
        3. Discussion
      7. Drawing a Rectangle
        1. Problem
        2. Solution
        3. Discussion
      8. Drawing a Circle
        1. Problem
        2. Solution
        3. Discussion
      9. Drawing an Ellipse
        1. Problem
        2. Solution
        3. Discussion
      10. Drawing a Triangle
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      11. Drawing Regular Polygons
        1. Problem
        2. Solution
        3. Discussion
      12. Drawing a Star
        1. Problem
        2. Solution
        3. Discussion
      13. Filling a Shape with a Solid or Translucent Color
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      14. Filling a Shape with a Gradient
        1. Problem
        2. Solution
        3. Discussion
      15. Filling a Shape with a Bitmap
        1. Problem
        2. Solution
        3. Discussion
      16. Scripting Masks
        1. Problem
        2. Solution
        3. Discussion
    11. 8. Bitmaps
      1. Introduction
      2. Creating a BitmapData Object
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. Adding a Bitmap to the Display List
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. Drawing a Display Object to a Bitmap
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. Loading an External Image into a Bitmap
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. Manipulating Pixels
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      7. Creating Rectangular Fills
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. Creating a Flood Fill
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      9. Copying Pixels
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      10. Copying Channels
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      11. Creating Noise
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      12. Creating Perlin Noise
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      13. Using Threshold
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      14. Applying a Filter to a Bitmap
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      15. Dissolving Between Two Bitmaps
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      16. Scrolling a Bitmap
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    12. 9. Text
      1. Introduction
      2. Creating an Outline Around a Text Field
        1. Problem
        2. Solution
        3. Discussion
      3. Creating a Background for a Text Field
        1. Problem
        2. Solution
        3. Discussion
      4. Making a User Input Field
        1. Problem
        2. Solution
        3. Discussion
      5. Making a Password Input Field
        1. Problem
        2. Solution
        3. Discussion
      6. Filtering Text Input
        1. Problem
        2. Solution
        3. Discussion
      7. Setting a Field’s Maximum Length
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. Displaying Text
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      9. Displaying HTML-Formatted Text
        1. Problem
        2. Solution
        3. Discussion
      10. Condensing Whitespace
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      11. Sizing Text Fields to Fit Contents
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      12. Scrolling Text Programmatically
        1. Problem
        2. Solution
        3. Discussion
      13. Responding to Scroll Events
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      14. Formatting Text
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      15. Formatting User-Input Text
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      16. Formatting a Portion of Existing Text
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      17. Setting a Text Field’s Font
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      18. Embedding Fonts
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      19. Creating Text that Can Be Rotated
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      20. Displaying Unicode Text
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      21. Assigning Focus to a Text Field
        1. Problem
        2. Solution
        3. Discussion
      22. Selecting Text with ActionScript
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      23. Setting the Insertion Point in a Text Field
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      24. Responding When Text Is Selected or Deselected
        1. Problem
        2. Solution
        3. Discussion
      25. Responding to User Text Entry
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      26. Adding a Hyperlink to Text
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      27. Calling ActionScript from Hyperlinks
        1. Problem
        2. Solution
        3. Discussion
      28. Working with Advanced Text Layout
        1. Problem
        2. Solution
        3. Discussion
      29. Applying Advanced Anti-Aliasing
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      30. Replacing Text
        1. Problem
        2. Solution
        3. Discussion
      31. Retrieving a List of System Fonts
        1. Problem
        2. Solution
        3. Discussion
    13. 10. Filters and Transforms
      1. Introduction
      2. Applying Color Changes
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. Applying Color Tints
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. Resetting Color
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. Shearing
        1. Problem
        2. Solution
        3. Discussion
      6. Applying Basic Filters
        1. Problem
        2. Solution
        3. Discussion
      7. Applying Advanced Filter Effects (Emboss, etc.)
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. Embossing
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      9. Detecting Edges
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      10. Sharpening
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      11. Making a Digital Negative
        1. Problem
        2. Solution
        3. Discussion
      12. Applying Grayscale
        1. Problem
        2. Solution
        3. Discussion
      13. Changing Saturation
        1. Problem
        2. Solution
        3. Discussion
      14. Changing Brightness
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      15. Changing Contrast
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    14. 11. Programmatic Animation
      1. Introduction
      2. Moving an Object
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. Moving an Object in a Specific Direction
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. Easing
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. Acceleration
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. Springs
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      7. Using Trigonometry
        1. Problem
        2. Solution
        3. Discussion
      8. Applying Animation Techniques to Other Properties
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    15. 12. Strings
      1. Introduction
      2. Joining Strings
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. Using Quotes and Apostrophes in Strings
        1. Problem
        2. Solution
        3. Discussion
      4. Inserting Special Whitespace Characters
        1. Problem
        2. Solution
        3. Discussion
      5. Searching for a Substring
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. Extracting a Substring
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      7. Parsing a String into Words
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. Removing and Replacing Characters and Words
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      9. Retrieving One Character at a Time
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      10. Converting Case
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      11. Trimming Whitespace
        1. Problem
        2. Solution
        3. Discussion
      12. Reversing a String by Word or by Character
        1. Problem
        2. Solution
        3. Discussion
      13. Converting Between Strings and Unicode or ASCII
        1. Problem
        2. Solution
        3. Discussion
    16. 13. Regular Expressions
      1. Introduction
      2. Understanding Regular Expression Patterns
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. Testing Regular Expressions
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. Looking for Pattern Matches
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. Removing and Replacing Characters and Words Using Patterns
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. Creating a Nongreedy Pattern
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      7. Validating User Input with Common Patterns
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    17. 14. Dates and Times
      1. Introduction
      2. Finding the Current Date and Time
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. Retrieving the Date Values
        1. Problem
        2. Solution
        3. Discussion
      4. Retrieving the Day or Month Name
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. Formatting the Date and Time
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. Formatting Seconds or Milliseconds as Minutes and Seconds
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      7. Converting Between DMYHMSM and Epoch Milliseconds
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. Using Timers
        1. Problem
        2. Solution
        3. Discussion
      9. Calculating Elapsed Time or Intervals Between Dates
        1. Problem
        2. Solution
        3. Discussion
      10. Parsing a Date from a String
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    18. 15. Programming Sound
      1. Introduction
      2. Creating a Sound Object and Loading a Sound
        1. Problem
        2. Solution
        3. Discussion
      3. Starting and Stopping a Sound
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. Setting the Buffer for a Sound
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. Offsetting the Start of a Sound
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. Playing a Sound Multiple Times (Looping)
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      7. Getting the Size of a Sound File
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. Reading the ID3 Tag of a Sound File
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      9. Find Out When a Sound Finishes Playing
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      10. Tracking the Progress of a Playing Sound
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      11. Pausing and Restarting a Sound
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      12. Reading the Level of a Sound
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      13. Stopping All Sounds
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      14. Reading the Sound Spectrum
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      15. Changing the Volume or Pan of a Sound
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      16. Creating a Sound Application
        1. Problem
        2. Solution
        3. Discussion
    19. 16. Video
      1. Introduction
      2. Loading and Playing Back Video
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. Controlling Video Sound
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. Reading Playback Time
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. Reading Video Duration
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. Controlling Playback Time
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      7. Scaling Video
        1. Problem
        2. Solution
        3. Discussion
      8. Managing and Monitoring Buffering and Loading
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      9. Listening for Cue Points
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      10. Applying Filters to Video
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      11. Pausing and Resuming Video
        1. Problem
        2. Solution
        3. Discussion
      12. Stopping Video
        1. Problem
        2. Solution
        3. Discussion
      13. Scrubbing Video
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      14. Clearing the Video Display
        1. Problem
        2. Solution
        3. Discussion
      15. Determining User Bandwidth
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    20. 17. Storing Persistent Data
      1. Introduction
      2. Creating and Opening a Local Shared Object
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. Writing Data to a Shared Object
        1. Problem
        2. Solution
        3. Discussion
      4. Saving a Local Shared Object
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. Reading Data from a Shared Object
        1. Problem
        2. Solution
        3. Discussion
      6. Removing Data from a Shared Object
        1. Problem
        2. Solution
        3. Discussion
      7. Serializing Custom Classes
        1. Problem
        2. Solution
        3. Discussion
      8. Sharing Data Between Flash Applications
        1. Problem
        2. Solution
        3. Discussion
      9. Controlling the Size of Local Shared Objects
        1. Problem
        2. Solution
        3. Discussion
    21. 18. Communicating with Other Movies
      1. Introduction
        1. See Also
      2. Creating Local Connections
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. Sending Data
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. Validating Receipt of Communication over Local Connections
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. Accepting Local Communications from Other Domains
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    22. 19. Sending and Loading Data
      1. Introduction
      2. Loading Variables from a Text File
        1. Problem
        2. Solution
        3. Discussion
      3. Loading Variables from a Server-Side Script
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. Loading a Block of Text (Including HTML and XML)
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. Checking Load Progress
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. Accessing Data Being Downloaded
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      7. Sending Data to a Server-Side Script
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. Sending Variables and Handling a Returned Result
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    23. 20. XML
      1. Introduction
      2. Understanding XML Structure (Reading and Writing XML)
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. Creating an XML Object
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. Adding Elements to an XML Object
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. Adding Text Nodes to an XML Object
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. Adding Attributes to an XML Element
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      7. Reading Elements in an XML Tree
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. Finding Elements by Name
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      9. Reading Text Nodes and Their Values
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      10. Reading an Element’s Attributes
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      11. Removing Elements, Text Nodes, and Attributes
        1. Problem
        2. Solution
        3. Discussion
      12. Loading XML
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      13. Loading XML from Different Domains
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      14. Sending XML
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      15. Searching XML
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      16. Using HTML and Special Characters in XML
        1. Problem
        2. Solution
        3. Discussion
    24. 21. Web Services and Flash Remoting
      1. Introduction
      2. Calling Web Services Methods
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. Handling Web Services Responses
        1. Problem
        2. Solution
        3. Discussion
      4. Handling Web Services Errors
        1. Problem
        2. Solution
        3. Discussion
      5. Calling Flash Remoting Methods
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. Handling Flash Remoting Responses
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    25. 22. Building Integrated Applications
      1. Introduction
      2. Calling JavaScript Functions
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. Calling ActionScript Functions
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. Passing Parameters from HTML
        1. Problem
        2. Solution
        3. Discussion
    26. 23. File Management
      1. Introduction
      2. Downloading Files
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. Detecting When a User Selects a File to Upload
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. Monitoring Download Progress
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. Browsing for Files
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. Filtering Files That Display in the Browser Window
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      7. Detecting When the User Has Selected a File to Upload
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      8. Uploading Files
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      9. Monitoring File Upload Progress
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
    27. 24. Socket Programming
      1. Introduction
      2. Connecting to a Socket Server
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      3. Sending Data
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      4. Receiving Data
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      5. Handshaking with a Socket Server
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      6. Disconnecting from a Socket Server
        1. Problem
        2. Solution
        3. Discussion
        4. See Also
      7. Handling Socket Errors
        1. Problem
        2. Solution
        3. Discussion
    28. 1. Unicode Escape Sequences for Latin 1 Characters
    29. Index
    30. About the Authors
    31. SPECIAL OFFER: Upgrade this ebook with O’Reilly