ActionScript 3.0 Bible

Book description

The updated edition on all the latest features and capabilities of ActionScript 3.0 and Flash Player 10.

ActionScript is a popular programming language used primarily for the development of Web sites and software. This update to the successful previous version introduces you to all the exciting new capabilities of ActionScript 3.0. You'll see how ActionScript 3.0 goes beyond its primary use of scripting Flash animations and is now an object-oriented evolution that runs ten times faster than previous versions and can be used in Adobe's new platforms, including Flex and AIR.

Hands-on instruction and step-by-step tutorials enhance your learning process as you discover everything you need to know in order to harness the power of ActionScript 3.0. You'll learn the nitty gritty of building Rich Internet Applications (RIA) and the ins and outs of putting the new features of ActionScript 3.0 to work for you.

  • ActionScript 3.0 goes beyond its original role as a scripting language and has added development features, incredible speed, and the ability to work with Flex and AIR

  • Shows you how to apply advanced graphic effects using Pixel Blender

  • Demonstrates the all-new text and typography capabilities

  • Addresses your new enhanced control over dynamic sound

  • Explains templated types and new vector data structures

ActionScript 3.0 Bible offers you a soup-to-nuts guide on all things ActionScript 3.0 so you can get started working with it immediately.

Table of contents

  1. Copyright
  2. About the Author
  3. Credits
  4. Acknowledgments
  5. Introduction
    1. What's New in This Edition
    2. Make Sure You Buy the Right Book
    3. How This Book Is Organized
      1. Part I: ActionScript 3.0 Language Basics
      2. Part II: Core ActionScript 3.0 Data Types
      3. Part III: The Display List
      4. Part IV: Event-Driven Programming
      5. Part V: Error Handling
      6. Part VI: External Data
      7. Part VII: Sound and Video
      8. Part VIII: Graphics Programming and Animation
      9. Part IX: Flash in Context
    4. Conventions and Features
      1. Icons
      2. Product Conventions
      3. Official Documentation
      4. Code Formatting and Conventions
    5. Running Example Code
      1. Online Examples
        1. System Requirements
        2. Running Code
        3. Downloading Code
        4. Community Features
      2. Flash Builder
        1. System Requirements
        2. Running Code
      3. Flash Professional
        1. System Requirements
        2. Running Code
      4. Other Tools
    6. On the Web Site
    7. Where to Go from Here
  6. I. ActionScript 3.0 Language Basics
    1. 1. Introducing ActionScript 3.0
      1. 1.1. What Is ActionScript 3.0?
      2. 1.2. Exploring the Flash Platform
        1. 1.2.1. A Programmer's Perspective
          1. 1.2.1.1. Language
          2. 1.2.1.2. API
          3. 1.2.1.3. Libraries
          4. 1.2.1.4. Compilers, Tools, and IDEs
          5. 1.2.1.5. SWFs
          6. 1.2.1.6. Flex
          7. 1.2.1.7. In Short
        2. 1.2.2. A User's Perspective
          1. 1.2.2.1. Runtimes
          2. 1.2.2.2. Platforms and Platform Independence
          3. 1.2.2.3. The Flash Player Zoo
          4. 1.2.2.4. In Short
      3. 1.3. From ActionScript 2.0 to ActionScript 3.0
        1. 1.3.1. Display List
        2. 1.3.2. Runtime Errors
        3. 1.3.3. Runtime Data Types
        4. 1.3.4. Method Closures
        5. 1.3.5. Intrinsic Event Model
        6. 1.3.6. Regular Expressions
        7. 1.3.7. E4X
      4. 1.4. Summary
    2. 2. ActionScript 3.0 Language Basics
      1. 2.1. The Bare Essentials
      2. 2.2. Using Variables
        1. 2.2.1. Anatomy of a Variable Declaration
        2. 2.2.2. Constants in This Changing World
        3. 2.2.3. Taking It Literally
      3. 2.3. Commenting Your Code
        1. 2.3.1. Types of Comments
          1. 2.3.1.1. Single-Line Comment
          2. 2.3.1.2. Block Comments
          3. 2.3.1.3. XML Comments
          4. 2.3.1.4. Javadoc Comments
        2. 2.3.2. When to Use Comments
        3. 2.3.3. Self-Commenting Code
      4. 2.4. Introducing Scope
      5. 2.5. Introducing the Data Types
        1. 2.5.1. Declaring Types
        2. 2.5.2. Using Untyped Variables
      6. 2.6. Connecting You to an Operator
        1. 2.6.1. Unary vs. Binary Operators
        2. 2.6.2. Order of Operations
        3. 2.6.3. Some Commonly Used Operators
          1. 2.6.3.1. Assignment (=)
          2. 2.6.3.2. Arithmetic (+, −, *, /)
          3. 2.6.3.3. Modulo (%)
          4. 2.6.3.4. Increment (++) and Decrement (--)
          5. 2.6.3.5. Compound Assignment Operators (+=, -=, *=, /=, and %=)
          6. 2.6.3.6. Comma Operator (,)
      7. 2.7. Making Logical Choices with Conditionals
        1. 2.7.1. if Statements
        2. 2.7.2. Equality (==)
        3. 2.7.3. Testing Other Comparisons
          1. 2.7.3.1. Greater Than (>) and Less Than (<)
          2. 2.7.3.2. Not Equal to (!=)
          3. 2.7.3.3. And (&&) and Or (||) Operators
          4. 2.7.3.4. Checking for Null Values
        4. 2.7.4. if..else
        5. 2.7.5. switch
        6. 2.7.6. The Conditional Operator
      8. 2.8. Repeating Actions Using Loops
        1. 2.8.1. Using for Loops
        2. 2.8.2. Using for..in and for each..in
          1. 2.8.2.1. for..in
          2. 2.8.2.2. for each..in
        3. 2.8.3. Using while and do..while
          1. 2.8.3.1. while
          2. 2.8.3.2. do..while
        4. 2.8.4. Battle of the Loop Structures: for vs. while
        5. 2.8.5. Avoiding Infinite Loops
        6. 2.8.6. Using break and continue
          1. 2.8.6.1. continue
          2. 2.8.6.2. break
      9. 2.9. Summary
    3. 3. Functions and Methods
      1. 3.1. Calling Functions
      2. 3.2. Creating Custom Functions
        1. 3.2.1. Defining a Function
        2. 3.2.2. Passing Arguments to Your Function
          1. 3.2.2.1. Passing by Reference or by Value
          2. 3.2.2.2. Setting Default Values
          3. 3.2.2.3. Using the Rest Parameter (...)
      3. 3.3. Returning Results
        1. 3.3.1. Returning a Value Using a return Statement
          1. 3.3.1.1. Defining a Return Type for Your Function
          2. 3.3.1.2. Returning void
      4. 3.4. Anonymous Functions
      5. 3.5. Functions as Objects
      6. 3.6. Recursive Functions
      7. 3.7. Summary
    4. 4. Object Oriented Programming
      1. 4.1. Understanding Classes
        1. 4.1.1. Classes Can Model the Real World
        2. 4.1.2. Classes Contain Data and Operations
        3. 4.1.3. Classes Separate Responsibilities
        4. 4.1.4. Classes Are Types
        5. 4.1.5. Classes Contain Your Program
      2. 4.2. Object Oriented Terminology
        1. 4.2.1. Object
        2. 4.2.2. Class
        3. 4.2.3. Instance
        4. 4.2.4. Type
      3. 4.3. Encapsulation: Classes Are Like, So Selfish
        1. 4.3.1. The Black Box Principle
        2. 4.3.2. Encapsulation and Polymorphism
      4. 4.4. Packages: Classes, Functions, and Packing Peanuts
        1. 4.4.1. Class Uniqueness and Namespaces
        2. 4.4.2. Hierarchy
        3. 4.4.3. Controlling Visibility
        4. 4.4.4. Code Allowed in Packages
        5. 4.4.5. Using Code from Packages
      5. 4.5. Using Inheritance
        1. 4.5.1. Structuring Code with Inheritance
        2. 4.5.2. Inheritance, Types, Polymorphism, and You
        3. 4.5.3. Inheritance vs. Composition
        4. 4.5.4. Preventing Inheritance
      6. 4.6. Access Control Attributes
        1. 4.6.1. Public and Private
        2. 4.6.2. Protected
        3. 4.6.3. Internal
        4. 4.6.4. Custom Access Control with Namespaces
      7. 4.7. Methods and Constructors
      8. 4.8. Properties
        1. 4.8.1. Accessors
        2. 4.8.2. Avoid Side Effects
        3. 4.8.3. Self-Referential Code
      9. 4.9. Using Static Methods and Properties
        1. 4.9.1. Static Variables
        2. 4.9.2. Static Constants
        3. 4.9.3. Enumerations
        4. 4.9.4. Static Methods
      10. 4.10. Overriding Behavior
        1. 4.10.1. Accessing the Superclass
      11. 4.11. Designing Interfaces
      12. 4.12. Manipulating Types
        1. 4.12.1. Type Compatibility and Coercion
        2. 4.12.2. Explicit Type Conversion
        3. 4.12.3. Determining Types
      13. 4.13. Creating Dynamic Classes
      14. 4.14. Summary
    5. 5. Validating Your Program
      1. 5.1. Introducing Errors
        1. 5.1.1. Compile-Time Errors vs. Runtime Errors
          1. 5.1.1.1. Compile-Time Errors
          2. 5.1.1.2. Runtime Errors
        2. 5.1.2. Warnings
        3. 5.1.3. Getting Feedback from Flash Professional and Flash Builder
          1. 5.1.3.1. Debugging in Flash Professional
          2. 5.1.3.2. Debugging in Flash Builder
      2. 5.2. Fixing Errors
      3. 5.3. Summary
  7. II. Core ActionScript 3.0 Data Types
    1. 6. Text, Strings, and Characters
      1. 6.1. Working with String Literals
        1. 6.1.1. Using Escaped Characters
      2. 6.2. Converting to and from Strings
        1. 6.2.1. Using toString()
        2. 6.2.2. Casting and Converting to Strings
        3. 6.2.3. Converting Strings into Other Types
          1. 6.2.3.1. Converting Strings to Numbers
          2. 6.2.3.2. Converting Strings to Arrays
      3. 6.3. Combining Strings
      4. 6.4. Converting the Case of a String
      5. 6.5. Using the Individual Characters in a String
        1. 6.5.1. Getting the Number of Characters in a String
        2. 6.5.2. Getting a Particular Character
        3. 6.5.3. Converting a Character to a Character Code
      6. 6.6. Searching within a String
        1. 6.6.1. Searching by Substring
        2. 6.6.2. Searching with Regular Expressions
      7. 6.7. String Dissection
      8. 6.8. String Encoding and International Text
      9. 6.9. Summary
    2. 7. Numbers, Math, and Dates
      1. 7.1. Understanding Numeric Types
        1. 7.1.1. Sets of Numbers
        2. 7.1.2. Representing Numbers
        3. 7.1.3. Digital Representations of Numbers
          1. 7.1.3.1. Unsigned Integers
          2. 7.1.3.2. Signed Integers
          3. 7.1.3.3. Floating-Point Numbers
      2. 7.2. Using Numbers in ActionScript
        1. 7.2.1. Number
        2. 7.2.2. int
        3. 7.2.3. uint
        4. 7.2.4. Literals
        5. 7.2.5. Edge Cases
          1. 7.2.5.1. Not a Number
          2. 7.2.5.2. Infinity
          3. 7.2.5.3. Minimum and Maximum Values
      3. 7.3. Manipulating Numbers
        1. 7.3.1. Numeric Conversions
        2. 7.3.2. String Conversions
      4. 7.4. Performing Arithmetic
      5. 7.5. Performing Trigonometric Calculations
      6. 7.6. Generating Randomness
      7. 7.7. Manipulating Dates and Times
        1. 7.7.1. Creating a Date
        2. 7.7.2. Epoch Time
        3. 7.7.3. Time zones
        4. 7.7.4. Accessing and Modifying a Date
        5. 7.7.5. Date Arithmetic
        6. 7.7.6. Execution Time
        7. 7.7.7. Formatting a Date
      8. 7.8. Summary
    3. 8. Arrays
      1. 8.1. Array Basics
        1. 8.1.1. Using the Array Constructor
        2. 8.1.2. Creating an Array by Using an Array Literal
        3. 8.1.3. Referencing Values in an Array
        4. 8.1.4. Finding the Number of Items in an Array
      2. 8.2. Converting Arrays to Strings
      3. 8.3. Adding and Removing Items from an Array
        1. 8.3.1. Appending Values to the End of Your Array with concat()
        2. 8.3.2. Applying Stack Operations push() and pop()
        3. 8.3.3. Applying Queue Operations shift() and unshift()
      4. 8.4. Slicing, Splicing, and Dicing
        1. 8.4.1. Inserting and Removing Values with splice()
        2. 8.4.2. Working with a Subset of your Array with slice()
      5. 8.5. Iterating through the Items in an Array
        1. 8.5.1. Using a for Loop
        2. 8.5.2. Using for each..in
        3. 8.5.3. Using the forEach() Method
      6. 8.6. Searching for Elements
      7. 8.7. Reordering Your Array
        1. 8.7.1. Using Sorting Functions
        2. 8.7.2. Flipping the Order of Your Array Using Reverse()
      8. 8.8. Applying Actions to All Elements of an Array
        1. 8.8.1. Conditional Processing with every(), some(), and filter()
        2. 8.8.2. Getting Results with the map() Method
      9. 8.9. Alternatives to Arrays
        1. 8.9.1. Associative Arrays
        2. 8.9.2. Multidimensional Arrays
      10. 8.10. Amazing Properties of Arrays
      11. 8.11. Summary
    4. 9. Vectors
      1. 9.1. Vector Basics
        1. 9.1.1. Why Do We Need Another Datatype?
        2. 9.1.2. Array: More Functionality Than You Require
        3. 9.1.3. Vectors: Arrays with Benefits
        4. 9.1.4. Fixed-Size Vectors
      2. 9.2. Generics and Parameterized Types
        1. 9.2.1. Vector as a Generic
        2. 9.2.2. No Generics for You
      3. 9.3. Generic Methods of Vector
      4. 9.4. Creating and Converting Vectors
        1. 9.4.1. Vector literals
        2. 9.4.2. Converting Types of Vectors
        3. 9.4.3. Converting a Vector into an Array
      5. 9.5. Summary
    5. 10. Objects and Dictionaries
      1. 10.1. Working with Objects
        1. 10.1.1. Dynamic Classes
        2. 10.1.2. Creating Objects
        3. 10.1.3. Accessing Object Properties
        4. 10.1.4. toString()
      2. 10.2. Using Objects and Dictionaries as Associative Arrays
        1. 10.2.1. Comparing Arrays, Objects, and Dictionaries
        2. 10.2.2. Testing for Existence
        3. 10.2.3. Removing Properties
        4. 10.2.4. Iterating
      3. 10.3. Using Objects for Named Arguments
      4. 10.4. Using Objects as Nested Data
        1. 10.4.1. XML as Objects
        2. 10.4.2. JSON
      5. 10.5. Summary
    6. 11. XML and E4X
      1. 11.1. Getting Started with XML in ActionScript
        1. 11.1.1. XML References
        2. 11.1.2. E4X References
        3. 11.1.3. XML Literals
        4. 11.1.4. A Brief Introduction to E4X Operators and Syntax
        5. 11.1.5. Legacy XML Handling
      2. 11.2. Querying XML
        1. 11.2.1. The Child Axis
        2. 11.2.2. The Wildcard Operator
        3. 11.2.3. Indexed Elements
        4. 11.2.4. The Attribute Axis
        5. 11.2.5. The Text Axis
        6. 11.2.6. The Descendant Axis
        7. 11.2.7. The Parent Axis
        8. 11.2.8. Custom Filter Axes
        9. 11.2.9. Quick Reference
      3. 11.3. Modifying XML
        1. 11.3.1. Inserting Nodes
          1. 11.3.1.1. Inserting with E4X Operators
          2. 11.3.1.2. Inserting with E4X Methods
        2. 11.3.2. Removing Nodes and Attributes
        3. 11.3.3. Duplicating XML
        4. 11.3.4. Replacing Nodes
      4. 11.4. Converting to and from Strings
        1. 11.4.1. Converting Strings to XML
        2. 11.4.2. Converting XML to Strings
          1. 11.4.2.1. Printing Pretty
          2. 11.4.2.2. Setting the Number of Spaces Per Indentation
          3. 11.4.2.3. Normalizing Text Nodes
      5. 11.5. Loading XML Data from External Sources
      6. 11.6. Gathering Meta-Information about XML Nodes
        1. 11.6.1. Finding Node Types
        2. 11.6.2. Determining the Type of Content in a Node
      7. 11.7. Using Namespaces
        1. 11.7.1. Creating XML Namespaces in ActionScript
          1. 11.7.1.1. Using the Namespace Class
          2. 11.7.1.2. Using the Namespace Keyword
          3. 11.7.1.3. Making Namespaces Available
        2. 11.7.2. Querying Namespaced XML Nodes
          1. 11.7.2.1. Opening Namespaces
          2. 11.7.2.2. Using the Scope Resolution Operator
          3. 11.7.2.3. Setting the Default XML Namespace
        3. 11.7.3. Querying XML for Namespaces
        4. 11.7.4. Additional Namespace Operations
      8. 11.8. Setting XML Options
      9. 11.9. Summary
    7. 12. Regular Expressions
      1. 12.1. Introducing Regular Expressions
      2. 12.2. Writing a Regular Expression
      3. 12.3. Applying Regular Expressions
        1. 12.3.1. String Methods and RegExp Methods
        2. 12.3.2. Testing
        3. 12.3.3. Locating
        4. 12.3.4. Identifying
        5. 12.3.5. Extracting
        6. 12.3.6. Replacing
        7. 12.3.7. Splitting
      4. 12.4. Constructing Expressions
        1. 12.4.1. Normal Characters
        2. 12.4.2. Dot Character
        3. 12.4.3. Escaped Characters
        4. 12.4.4. Metacharacters and Metasequences Demystified
        5. 12.4.5. Character Classes
        6. 12.4.6. Quantifiers
        7. 12.4.7. Anchors and Boundaries
        8. 12.4.8. Alternation
        9. 12.4.9. Groups
      5. 12.5. Regular Expression Flags
        1. 12.5.1. Global
        2. 12.5.2. Ignore Case
        3. 12.5.3. Multiline
        4. 12.5.4. Dotall
        5. 12.5.5. Extended
      6. 12.6. Constructing Advanced Expressions
        1. 12.6.1. Greedy and Lazy Matching
        2. 12.6.2. Backreferences
        3. 12.6.3. Lookahead and Noncapturing Groups
          1. 12.6.3.1. Noncapturing Groups
          2. 12.6.3.2. Positive Lookahead Groups
          3. 12.6.3.3. Negative Lookahead Groups
        4. 12.6.4. Named Groups
        5. 12.6.5. International Concerns
      7. 12.7. Using the RegExp Class
        1. 12.7.1. Building Dynamic Expressions with String Operations
        2. 12.7.2. RegExp Public Properties
      8. 12.8. Summary
    8. 13. Binary Data and ByteArrays
      1. 13.1. Binary Concepts
      2. 13.2. Bit Math and Operators
        1. 13.2.1. Basic Arithmetic
        2. 13.2.2. Bit Shifting
        3. 13.2.3. Bitwise Logic
      3. 13.3. Binary Types in ActionScript
      4. 13.4. Using ByteArray
        1. 13.4.1. Creating a ByteArray
        2. 13.4.2. Writing Data
        3. 13.4.3. Reading Data
        4. 13.4.4. Compressing and Decompressing
      5. 13.5. Common Uses of ByteArrays
        1. 13.5.1. Loading Images
        2. 13.5.2. Copying Objects
      6. 13.6. Summary
  8. III. The Display List
    1. 14. Visual Programming with the Display List
      1. 14.1. Introducing Display Lists and Display Objects
        1. 14.1.1. Structure of the Display List
        2. 14.1.2. Coordinate Spaces
        3. 14.1.3. Manipulating the Display List
          1. 14.1.3.1. Creating a New Display Object
          2. 14.1.3.2. Adding an Object to a Display List
          3. 14.1.3.3. Removing an Object from a Display List
          4. 14.1.3.4. Re-sorting Depths
          5. 14.1.3.5. Reparenting Display Objects
          6. 14.1.3.6. Examining Display Lists
      2. 14.2. Display Object Classes
        1. 14.2.1. DisplayObject
        2. 14.2.2. InteractiveObject
        3. 14.2.3. DisplayObjectContainer
        4. 14.2.4. Shape
        5. 14.2.5. Bitmap
        6. 14.2.6. Video
        7. 14.2.7. AVM1Movie
        8. 14.2.8. SimpleButton
        9. 14.2.9. TextField
        10. 14.2.10. Sprite
        11. 14.2.11. MovieClip
        12. 14.2.12. Loader
        13. 14.2.13. Stage
          1. 14.2.13.1. Resizing
          2. 14.2.13.2. Changing SWF Properties
          3. 14.2.13.3. Going Full-Screen
          4. 14.2.13.4. Device Orientation
          5. 14.2.13.5. Event Source and Focus Manager
          6. 14.2.13.6. Color Correction
      3. 14.3. Geometry Classes
        1. 14.3.1. Point
        2. 14.3.2. Rectangle
      4. 14.4. Putting the Display List to Use
        1. 14.4.1. Drag-and-Drop, Hit Testing
        2. 14.4.2. Nesting and Cumulative Transformations
        3. 14.4.3. Full-Screen and Stage Resizing
      5. 14.5. Rendering and Performance
        1. 14.5.1. Stage Size and Dirty Rectangles
        2. 14.5.2. Number of Display Objects
        3. 14.5.3. Alpha, Blend Modes, Masking, and Filters
        4. 14.5.4. Text
        5. 14.5.5. Bitmaps, Vectors, and Bitmap Caching
        6. 14.5.6. More on Rendering
      6. 14.6. Summary
    2. 15. Working in Three Dimensions
      1. 15.1. Introducing 3D in ActionScript 3.0
        1. 15.1.1. The 3D Coordinate System
        2. 15.1.2. 3D in Flash Professional
        3. 15.1.3. Limitations of 3D Display Objects
          1. 15.1.3.1. Display Objects Are Flat
          2. 15.1.3.2. A Viewport Isn't a Camera
          3. 15.1.3.3. Depths Are Managed by the DisplayObjectContainer
          4. 15.1.3.4. Other Missing Stuff
      2. 15.2. DisplayObject Revisited
      3. 15.3. Geometry Revisited
      4. 15.4. Mouse and Point Translation in 3D
        1. 15.4.1. Translating Points in Code
      5. 15.5. Modifying the Projection
      6. 15.6. Software 3D Libraries
      7. 15.7. Summary
    3. 16. Working with DisplayObjects in Flash Professional
      1. 16.1. The Stage, Symbols, and the Library
        1. 16.1.1. Creating Symbols
        2. 16.1.2. Named Instances
        3. 16.1.3. Nested Instances
        4. 16.1.4. Associating Symbols to Classes
        5. 16.1.5. Writing an Associated Class
        6. 16.1.6. Nongraphic Symbol Types
      2. 16.2. Exporting and Using Assets
        1. 16.2.1. Using Assets from a SWC
        2. 16.2.2. Using Assets from a SWF
      3. 16.3. Summary
    4. 17. Text, Styles, and Fonts
      1. 17.1. Introducing TextFields
        1. 17.1.1. Creating a New TextField
        2. 17.1.2. Adding and Replacing Text
        3. 17.1.3. Setting a TextField's Size
        4. 17.1.4. Setting a TextField's Scaling and Rotation
        5. 17.1.5. Wrapping Text
        6. 17.1.6. Preventing User Selection
        7. 17.1.7. Displaying Multilingual Text and Symbols
      2. 17.2. Text with HTML and CSS
        1. 17.2.1. HTML Support in TextField
        2. 17.2.2. Adding Images or SWF Files to a TextField with <img>
        3. 17.2.3. Supported CSS Properties
        4. 17.2.4. The StyleSheet Object and CSS Parsing
      3. 17.3. Background and Border Treatments
      4. 17.4. Styling Text with TextFormats
        1. 17.4.1. align
        2. 17.4.2. blockIndent
        3. 17.4.3. bold
        4. 17.4.4. bullet
        5. 17.4.5. color
        6. 17.4.6. font
        7. 17.4.7. indent
        8. 17.4.8. italic
        9. 17.4.9. leading
        10. 17.4.10. letterSpacing
        11. 17.4.11. leftMargin
        12. 17.4.12. rightMargin
        13. 17.4.13. size
        14. 17.4.14. tabStops
        15. 17.4.15. target
        16. 17.4.16. underline
        17. 17.4.17. url
      5. 17.5. Input TextFields
        1. 17.5.1. The Three Kinds of Text Fields
        2. 17.5.2. Making a TextField an Input Field
        3. 17.5.3. Restricting User Input
        4. 17.5.4. Tab-Accessible Input Text Fields
        5. 17.5.5. Password Text Fields
      6. 17.6. Interaction with TextField Events
        1. 17.6.1. focusIn and focusOut Events
        2. 17.6.2. Text Input Events
        3. 17.6.3. Link Events
        4. 17.6.4. Scroll Events
      7. 17.7. Interactive Typography
        1. 17.7.1. Text by Lines and Paragraphs
        2. 17.7.2. Finding Text by Location
        3. 17.7.3. Locating and Measuring Text
        4. 17.7.4. Scrolling Text
      8. 17.8. Fonts
        1. 17.8.1. Device Fonts and Embedded Fonts
        2. 17.8.2. Managing Active Fonts and the Font Object
        3. 17.8.3. Embedding Fonts
          1. 17.8.3.1. Flash Builder, Flex Builder, Flex SDK, mxmlc
          2. 17.8.3.2. Flash Professional
        4. 17.8.4. Loading Fonts Dynamically
        5. 17.8.5. Using Embedded Fonts
        6. 17.8.6. Anti-aliasing
          1. 17.8.6.1. Fitting Edges to a Grid
          2. 17.8.6.2. Sharpness and Thickness
      9. 17.9. Summary
    5. 18. Advanced Text Layout
      1. 18.1. Understanding Advanced Text Controls
        1. 18.1.1. Advanced Text Controls in Development Tools
        2. 18.1.2. Why There Are Two Engines
        3. 18.1.3. Where to Go from Here
      2. 18.2. The Flash Text Engine
      3. 18.3. The Text Layout Framework
        1. 18.3.1. Storing Content and Formatting with Models
        2. 18.3.2. Laying Out Text with Controllers
          1. 18.3.2.1. Simple Composition with TextLine Factories
          2. 18.3.2.2. Linked Container Composition with ContainerControllers and FlowComposers
        3. 18.3.3. Text Layout Markup
          1. 18.3.3.1. Setting Up TLF Markup
          2. 18.3.3.2. TLF Tags
          3. 18.3.3.3. Importing and Exporting Markup
        4. 18.3.4. Available Formatting Options
        5. 18.3.5. Editing Features
        6. 18.3.6. Undo and Redo History
        7. 18.3.7. Programmatic Editing
          1. 18.3.7.1. Clipboard
          2. 18.3.7.2. Events
        8. 18.3.8. Flow and Container Configuration
        9. 18.3.9. A TextField Adapter Class
      4. 18.4. Fonts Revisited
        1. 18.4.1. Embedding CFF Fonts
          1. 18.4.1.1. Using Flash Professional
          2. 18.4.1.2. Using the Embed Tag
        2. 18.4.2. Font Lookup
      5. 18.5. Summary
    6. 19. Printing
      1. 19.1. Why Print from Flash?
      2. 19.2. Controlling Printer Output from Flash
        1. 19.2.1. Introducing the PrintJob Class
        2. 19.2.2. Starting a Print Request
        3. 19.2.3. Determining the Print Target and its Formatting Options
          1. 19.2.3.1. Printing Targets as Vectors
          2. 19.2.3.2. Printing Targets as Bitmaps
          3. 19.2.3.3. Scaling Screen Dimensions to Print Dimensions
        4. 19.2.4. Potential Issues with the Flash-Printed Output
      3. 19.3. Adding Print Functionality to Applications
      4. 19.4. Summary
  9. IV. Event-Driven Programming
    1. 20. Events and the Event Flow
      1. 20.1. Introducing Events
        1. 20.1.1. Saturday Morning Events
        2. 20.1.2. Event Terminology
          1. 20.1.2.1. Event
          2. 20.1.2.2. Type
          3. 20.1.2.3. Target
          4. 20.1.2.4. Dispatcher
          5. 20.1.2.5. Listener
          6. 20.1.2.6. Handler
          7. 20.1.2.7. Flow
          8. 20.1.2.8. Phase
      2. 20.2. The EventDispatcher Class
        1. 20.2.1. Using EventDispatcher
        2. 20.2.2. Using EventDispatcher by Composition
      3. 20.3. Working with Event Objects
      4. 20.4. Adding and Removing Event Listeners
      5. 20.5. The Event Flow
        1. 20.5.1. The Phases of Event Flow
          1. 20.5.1.1. Capture Phase
          2. 20.5.1.2. Target Phase
          3. 20.5.1.3. Bubble Phase
        2. 20.5.2. Event Flow in Action
      6. 20.6. Preventing Default Behaviors
      7. 20.7. Summary
    2. 21. Interactivity with the Mouse and Keyboard
      1. 21.1. Mouse and Keyboard Event Handling
        1. 21.1.1. Finding the Target
        2. 21.1.2. Bubbling and Nested Clips
        3. 21.1.3. Listening for All Events
      2. 21.2. Mouse Interactions
        1. 21.2.1. Clicking
        2. 21.2.2. Button Mode and the Hand Cursor
        3. 21.2.3. Complex Clicking
          1. 21.2.3.1. Keyboard Modifiers
          2. 21.2.3.2. Double-Clicking
        4. 21.2.4. Rollovers
        5. 21.2.5. Dragging
        6. 21.2.6. Position Tracking and Cursors
        7. 21.2.7. Blocking All Mouse Input
        8. 21.2.8. Mouse Wheel
      3. 21.3. Keyboard Interactions
        1. 21.3.1. Interpreting Keypresses
        2. 21.3.2. Modifier Keys
        3. 21.3.3. Related Events
        4. 21.3.4. IMEs
      4. 21.4. Focus
        1. 21.4.1. Finding or Setting the Current Focus
        2. 21.4.2. Focus Events
        3. 21.4.3. Tabbing
        4. 21.4.4. Focus Rectangle
      5. 21.5. Context Menus
        1. 21.5.1. Creating and Setting a Context Menu
        2. 21.5.2. Customizing Default Items
        3. 21.5.3. Adding Custom Items
      6. 21.6. Summary
    3. 22. Timers and Time-Driven Programming
      1. 22.1. Timer Basics
        1. 22.1.1. Creating a Timer
        2. 22.1.2. Listening for Timer Events
        3. 22.1.3. Starting, Stopping, and Resetting the Timer
      2. 22.2. Handling Timer Events
      3. 22.3. Delaying the Execution of a Function
      4. 22.4. Creating a World Clock
      5. 22.5. Enterframe Events
      6. 22.6. Other Time-Related Functions
        1. 22.6.1. getTimer()
        2. 22.6.2. setTimeout()
        3. 22.6.3. setInterval()
        4. 22.6.4. clearInterval()
      7. 22.7. Aside: Threads
      8. 22.8. Summary
    4. 23. Multitouch and Accelerometer Input
      1. 23.1. Planning for Your Audience
      2. 23.2. Using Multitouch
        1. 23.2.1. Touch Mode
          1. 23.2.1.1. Event Object Properties Shared by MouseEvent
          2. 23.2.1.2. Event Object Properties Unique to TouchEvent
          3. 23.2.1.3. Putting It Together
        2. 23.2.2. Gesture Mode
          1. 23.2.2.1. Special Properties of PressAndTapGestureEvent
          2. 23.2.2.2. Special Properties of TransformGestureEvent
          3. 23.2.2.3. Putting It Together
        3. 23.2.3. Touch-Related Methods
      3. 23.3. Using the Accelerometer
      4. 23.4. Other Sensors
      5. 23.5. Summary
  10. V. Error Handling
    1. 24. Errors and Exceptions
      1. 24.1. Comparing Ways to Fail
      2. 24.2. Understanding Exceptions
        1. 24.2.1. Throwing Exceptions
        2. 24.2.2. Catching Exceptions with Try and Catch
        3. 24.2.3. The Exception Flow
        4. 24.2.4. Uncaught Exceptions
        5. 24.2.5. The finally Clause
        6. 24.2.6. Rethrowing Exceptions
      3. 24.3. Errors Generated by Flash Player
      4. 24.4. Custom Exceptions
      5. 24.5. Handling Asynchronous Errors
      6. 24.6. Capturing Unhandled Events
      7. 24.7. Summary
    2. 25. Using the AVM2 Debugger
      1. 25.1. Introducing Debugging
      2. 25.2. Launching the Debugger
        1. 25.2.1. Starting and Stopping the Flash Professional Debugger
        2. 25.2.2. Starting and Stopping the Flash Builder Debugger
        3. 25.2.3. Debuggers Compared
      3. 25.3. Taking Control of Execution
        1. 25.3.1. Stopping at an Uncaught Exception
        2. 25.3.2. Stopping at a Breakpoint
        3. 25.3.3. Stopping on Demand
      4. 25.4. Pulling Back the Curtain
        1. 25.4.1. Interpreting the Variables Panel
        2. 25.4.2. Flash Builder Variables Panel and Watches
      5. 25.5. Navigating through Code
        1. 25.5.1. Continue
        2. 25.5.2. The Call Stack
        3. 25.5.3. Step Into
        4. 25.5.4. Step Over
        5. 25.5.5. Step Out
      6. 25.6. Debugging a Simple Example
      7. 25.7. Using the Debugger Effectively
      8. 25.8. Summary
    3. 26. Making Your Application Fault-Tolerant
      1. 26.1. Developing a Strategy
      2. 26.2. Determining What Errors to Handle
      3. 26.3. Categorizing Failures
      4. 26.4. Logging Errors
      5. 26.5. Messaging the User
      6. 26.6. Degrading Styles: An Example
      7. 26.7. Summary
  11. VI. External Data
    1. 27. Networking Basics and Flash Player Security
      1. 27.1. HTTP in Brief
      2. 27.2. Introducing URLRequest
      3. 27.3. Navigating to a Web Page
      4. 27.4. Loader
        1. 27.4.1. Graphics File Formats
        2. 27.4.2. Accessing Information about the Loading Process
          1. 27.4.2.1. LoaderInfo versus ContentLoaderInfo
          2. 27.4.2.2. Loading Events
          3. 27.4.2.3. The LoaderInfo Class
        3. 27.4.3. Getting Loaded Content
        4. 27.4.4. Loading External SWFs
          1. 27.4.4.1. Instantiating Classes from External SWFs
          2. 27.4.4.2. Interacting with Loaded SWFs
          3. 27.4.4.3. Loading AVM1 SWFs
        5. 27.4.5. Using Loader to Interpret Files in Memory
      5. 27.5. URLLoader
        1. 27.5.1. Loading a File
        2. 27.5.2. Loading and Canceling
        3. 27.5.3. Tracking Load Progress
        4. 27.5.4. Loading Different Formats
          1. 27.5.4.1. Loading XML
          2. 27.5.4.2. Loading CSS
          3. 27.5.4.3. Loading a Binary File
          4. 27.5.4.4. Loading URL-Encoded Variables
      6. 27.6. Sending Variables with URLRequest
        1. 27.6.1. Request and Response with URLLoader
        2. 27.6.2. Request Only with sendToUrl()
      7. 27.7. Understanding Flash Player Security
      8. 27.8. Summary
    2. 28. Communicating with Remote Services
      1. 28.1. Web Services Using HTTP
        1. 28.1.1. REST
        2. 28.1.2. SOAP
        3. 28.1.3. XML-RPC
      2. 28.2. Socket Services
      3. 28.3. XML Socket Services
      4. 28.4. Flash Remoting
        1. 28.4.1. NetConnection
        2. 28.4.2. Responder
      5. 28.5. Summary
    3. 29. Storing and Sending Data with SharedObject
      1. 29.1. Comparing Approaches to Persistent Storage
        1. 29.1.1. Storing Information in a Local Shared Object
        2. 29.1.2. Storing Information in Local Files
        3. 29.1.3. Storing Information on a Server
        4. 29.1.4. Storing Information in the Browser
      2. 29.2. Identifying Useful Situations for Shared Objects
      3. 29.3. Shared Objects and Remoting
      4. 29.4. Using SharedObjects
        1. 29.4.1. Retrieving a SharedObject
        2. 29.4.2. Reading from and Writing to a SharedObject
        3. 29.4.3. Deleting Information from a SharedObject
        4. 29.4.4. Saving Information
      5. 29.5. Sharing Information between SWFs
        1. 29.5.1. Requiring a Secure Connection
        2. 29.5.2. Sharing with ActionScript 1.0 and 2.0 SWFs
      6. 29.6. Working with Size Constraints
        1. 29.6.1. User Settings
        2. 29.6.2. User Requests
        3. 29.6.3. Asking for Space before It's Too Late
        4. 29.6.4. Asking for Space up Front
        5. 29.6.5. Using flush()
        6. 29.6.6. Viewing Used Space
      7. 29.7. Storing Custom Classes
        1. 29.7.1. Storing Custom Classes without Modification
        2. 29.7.2. Creating Self-Serializing Classes
      8. 29.8. Summary
    4. 30. File Access
      1. 30.1. Abilities of the File API
      2. 30.2. Introducing FileReference
        1. 30.2.1. Choosing a File
        2. 30.2.2. Determining When a File Is Selected
        3. 30.2.3. Retrieving File Properties
      3. 30.3. Uploading a File
      4. 30.4. Adding Upload Handling to a Server
      5. 30.5. Downloading a File to Disk
      6. 30.6. Loading a File into Memory
      7. 30.7. Saving Data to Disk
      8. 30.8. Summary
  12. VII. Sound and Video
    1. 31. Playing and Generating Sound
      1. 31.1. An Overview of the Sound System
      2. 31.2. Prepping and Playing Sound Objects
        1. 31.2.1. Loading a Sound from an External File or URL
        2. 31.2.2. Buffering a Streaming Sound
        3. 31.2.3. Embedding Sounds in a SWF
          1. 31.2.3.1. Embedding Sound with Flash Professional
          2. 31.2.3.2. Embedding Sound with Flash Builder
          3. 31.2.3.3. Accessing Embedded Sounds
      3. 31.3. Controlling Sound Playback
        1. 31.3.1. Playing and Stopping
        2. 31.3.2. Seeking and Looping
        3. 31.3.3. Fast-Forwarding, Rewinding, Pausing, and Restarting a Sound
      4. 31.4. Applying Sound Transformations
      5. 31.5. Working with a Sound's Metadata
        1. 31.5.1. Checking Load Progress
        2. 31.5.2. Getting a Song's ID3 Data
      6. 31.6. Sampling Audio
      7. 31.7. Extracting Audio
      8. 31.8. Synthesizing Audio
      9. 31.9. Detecting Audio Capabilities
      10. 31.10. Summary
    2. 32. Playing Video
      1. 32.1. Video and the Flash Platform
        1. 32.1.1. Video Sources
          1. 32.1.1.1. Embedded
          2. 32.1.1.2. Video Files and Streams
          3. 32.1.1.3. Webcam
        2. 32.1.2. Codecs and Container Formats
        3. 32.1.3. Metainformation
          1. 32.1.3.1. Metadata
          2. 32.1.3.2. Cue Points
          3. 32.1.3.3. Subscripttitles and Closed Captioning
        4. 32.1.4. Delivery Methods
          1. 32.1.4.1. Local, Progressive Download
          2. 32.1.4.2. Streaming
          3. 32.1.4.3. Delivery Networks
        5. 32.1.5. Encoding
          1. 32.1.5.1. Adobe Media Encoder
          2. 32.1.5.2. Exporting from Applications
          3. 32.1.5.3. Video Encoding Services
        6. 32.1.6. Playback
          1. 32.1.6.1. Video Acceleration
          2. 32.1.6.2. Video Players
          3. 32.1.6.3. Open Source Media Framework
      2. 32.2. Implementing a Video Player
        1. 32.2.1. Video
        2. 32.2.2. NetConnection
        3. 32.2.3. NetStream
        4. 32.2.4. Putting It All Together
      3. 32.3. Summary
    3. 33. Capturing Sound and Video
      1. 33.1. Video Input Using a Camera
        1. 33.1.1. Retrieving a Camera Object
        2. 33.1.2. Viewing Video from a Camera
        3. 33.1.3. Tweaking Camera Settings
        4. 33.1.4. Detecting Camera Activity
        5. 33.1.5. Capturing and Analyzing Camera Data
      2. 33.2. Sound Input Using a Microphone
        1. 33.2.1. Retrieving a Microphone Object
        2. 33.2.2. Playing Back Microphone Input
        3. 33.2.3. Tweaking Microphone Settings
          1. 33.2.3.1. Sound Recording Settings
          2. 33.2.3.2. Sound Compression Settings
        4. 33.2.4. Detecting Microphone Activity
          1. 33.2.4.1. Overall Activity
          2. 33.2.4.2. Voice Activity
        5. 33.2.5. Capturing and Analyzing Microphone Data
      3. 33.3. Flash Media Servers
      4. 33.4. Summary
  13. VIII. Graphics Programming and Animation
    1. 34. Geometric and Color Transformations
      1. 34.1. DisplayObject and the Transform Object
      2. 34.2. 2D Affine Transformations
        1. 34.2.1. Matrices and Coordinates
        2. 34.2.2. Kinds of Affine Transform and Their Matrices
          1. 34.2.2.1. The Identity Matrix
        3. 34.2.3. Translation
        4. 34.2.4. Scale
        5. 34.2.5. Rotation
        6. 34.2.6. Skew
        7. 34.2.7. The Matrix Class
          1. 34.2.7.1. Transform Methods
          2. 34.2.7.2. Utility Methods
        8. 34.2.8. Order of Application
        9. 34.2.9. Applying Transformation Matrices
      3. 34.3. Color Transforms
        1. 34.3.1. Color Fills
        2. 34.3.2. Color Transformation Math
        3. 34.3.3. Resetting and Combining Color Transforms
        4. 34.3.4. Applying Color Transformations
      4. 34.4. 3D Transformations
        1. 34.4.1. Basic 3D Concepts Review
          1. 34.4.1.1. Coordinate System
          2. 34.4.1.2. Points
          3. 34.4.1.3. Vectors
          4. 34.4.1.4. Matrices
          5. 34.4.1.5. Orientation
        2. 34.4.2. 3D Affine Transformations
        3. 34.4.3. Projection Transformations
        4. 34.4.4. 3D Transformations in ActionScript
          1. 34.4.4.1. Vector3D
          2. 34.4.4.2. Matrix3D
      5. 34.5. Summary
    2. 35. Programming Vector Graphics
      1. 35.1. Overview
      2. 35.2. Drawing Basics
        1. 35.2.1. Moving the Pen
        2. 35.2.2. Straight Line Segments
        3. 35.2.3. Curved Line Segments
        4. 35.2.4. Filling a Path
        5. 35.2.5. Clearing Graphics
      3. 35.3. Setting Drawing Styles
        1. 35.3.1. Solid Colors
        2. 35.3.2. Gradients
        3. 35.3.3. Bitmaps
        4. 35.3.4. Shaders
      4. 35.4. Drawing Primitives
        1. 35.4.1. Rectangles and Squares
        2. 35.4.2. Circles and Ellipses
        3. 35.4.3. Rounded Rectangles
      5. 35.5. Example: A Drawing Application
      6. 35.6. Batched Drawing
        1. 35.6.1. Drawing a Path
          1. 35.6.1.1. Finally, the Method
          2. 35.6.1.2. Winding
          3. 35.6.1.3. Example: Drawing a Glyph
        2. 35.6.2. Storing a Path in a Command
        3. 35.6.3. Batching Generic Drawing Commands
        4. 35.6.4. Copying and Pasting Drawings
      7. 35.7. 3D Drawing
      8. 35.8. Summary
    3. 36. Programming Bitmap Graphics
      1. 36.1. Bitmaps and Their Applications
      2. 36.2. Creating and Displaying Bitmaps
        1. 36.2.1. Creating Empty BitmapData Instances
        2. 36.2.2. Creating Instances of Embedded Assets
        3. 36.2.3. Displaying Bitmaps
        4. 36.2.4. Bitmap Quality
        5. 36.2.5. Disposing Bitmap Data
      3. 36.3. Capturing and Copying Bitmaps
        1. 36.3.1. Copying from Display Objects
        2. 36.3.2. Copying from BitmapData Objects
          1. 36.3.2.1. Drawing from Another Bitmap
          2. 36.3.2.2. Cloning a BitmapData Object
          3. 36.3.2.3. Copying Pixels
          4. 36.3.2.4. Copying Channels
          5. 36.3.2.5. Merging BitmapData Images
      4. 36.4. Pixel-Level Access
        1. 36.4.1. Accessing Single Pixels
        2. 36.4.2. Accessing Bitmap Data in Memory
          1. 36.4.2.1. Using ByteArray
          2. 36.4.2.2. Using Vector
      5. 36.5. Working with Colors
        1. 36.5.1. Filling with a Solid Color
        2. 36.5.2. Replacing a Color with a Flood Fill
        3. 36.5.3. Color Transforms
        4. 36.5.4. Retrieving a Histogram
        5. 36.5.5. Replacing Colors with Threshold
        6. 36.5.6. Remapping Colors with Palette Mapping
        7. 36.5.7. Detecting Areas of a Solid Color
      6. 36.6. Bitmap Effects
        1. 36.6.1. Applying Filters
        2. 36.6.2. Scrolling a Bitmap
        3. 36.6.3. Using Pixel Dissolves
        4. 36.6.4. Making Noise
          1. 36.6.4.1. Random Noise
          2. 36.6.4.2. Perlin Noise
      7. 36.7. Summary
    4. 37. Applying Filters
      1. 37.1. Introducing Filters
        1. 37.1.1. Applying Filters to Display Objects
        2. 37.1.2. Multiple Filters
      2. 37.2. Blurs
      3. 37.3. Drop Shadows
      4. 37.4. Bevels
      5. 37.5. Gradient Bevels
      6. 37.6. Glows
      7. 37.7. Gradient Glows
      8. 37.8. Color Effects
        1. 37.8.1. Brightness
        2. 37.8.2. Tint
        3. 37.8.3. Negative
        4. 37.8.4. Contrast
        5. 37.8.5. Convert to Grayscale
        6. 37.8.6. Saturation
      9. 37.9. Convolution Filters
      10. 37.10. Displacement Maps
      11. 37.11. Shaders
      12. 37.12. Summary
    5. 38. Writing Shaders with Pixel Bender
      1. 38.1. Introducing Pixel Bender
        1. 38.1.1. The Case for Pixel Shaders
        2. 38.1.2. Thinking Like a Pixel Shader
        3. 38.1.3. Integrating Pixel Bender and Flash Player
      2. 38.2. Pixel Bender Kernel Language
        1. 38.2.1. Syntax
        2. 38.2.2. Structure of a Kernel
          1. 38.2.2.1. Required Metadata
          2. 38.2.2.2. Member Declarations
        3. 38.2.3. Basic Control Structures
        4. 38.2.4. Types
          1. 38.2.4.1. Vector Types
          2. 38.2.4.2. Matrix Types
          3. 38.2.4.3. Image Types
          4. 38.2.4.4. Stuff You Don't Get
        5. 38.2.5. Functions
      3. 38.3. Interfacing with Pixel Bender Kernels
        1. 38.3.1. Loading the Bytecode
        2. 38.3.2. Running a Kernel in ActionScript
        3. 38.3.3. Manipulating a Kernel
        4. 38.3.4. A Basic Shader in ActionScript
        5. 38.3.5. An Effect Shader in ActionScript
      4. 38.4. Bending Other Data
        1. 38.4.1. Preparing Data for Pixel Bender
          1. 38.4.1.1. BitmapData
          2. 38.4.1.2. Vector
          3. 38.4.1.3. ByteArray
        2. 38.4.2. Accessing Data in the Kernel
        3. 38.4.3. Executing and Monitoring ShaderJobs
        4. 38.4.4. The Double-Shader Experiment
      5. 38.5. Summary
    6. 39. Scripting Animation
      1. 39.1. Understanding Flash Player and Animation
        1. 39.1.1. Frame Rate
        2. 39.1.2. Flash Player Operation
      2. 39.2. Animating with Code
        1. 39.2.1. Animating by Time
        2. 39.2.2. Animating by Frames
        3. 39.2.3. Animation and Speed
      3. 39.3. Animating Using Flash Professional
        1. 39.3.1. Review: Tweens, Keyframes, and Easing
        2. 39.3.2. Introducing Motion XML
          1. 39.3.2.1. The Motion Object
          2. 39.3.2.2. The Source Object
          3. 39.3.2.3. The Keyframe Object
          4. 39.3.2.4. The Color Object
          5. 39.3.2.5. Filter Objects
          6. 39.3.2.6. The ITween Objects
        3. 39.3.3. Using the Flash Motion Package
      4. 39.4. Animating Using Flex
      5. 39.5. Choosing a Third-Party Animation Toolkit
      6. 39.6. Summary
    7. 40. Advanced 3D
      1. 40.1. Game Plan
      2. 40.2. Projecting Batches of Points
      3. 40.3. Triangle Strips
      4. 40.4. Backface Culling
      5. 40.5. Texture Mapping
      6. 40.6. Z-Sorting, Shading, and Further Topics
        1. 40.6.1. Polygon Z-Sorting
        2. 40.6.2. Shading and Lighting Introduced
          1. 40.6.2.1. Normal Maps
          2. 40.6.2.2. Shading with a Normal Map
      7. 40.7. Summary
  14. IX. Flash in Context
    1. 41. Globalization, Accessibility, and Color Correction
      1. 41.1. Globalization and Localization
        1. 41.1.1. Identifying Locale
          1. 41.1.1.1. Using the Default That the Operating System Provides
          2. 41.1.1.2. Based on Location
          3. 41.1.1.3. Based on the Browser
          4. 41.1.1.4. Based on the Browser's Configuration
          5. 41.1.1.5. Just Ask
          6. 41.1.1.6. An Example
          7. 41.1.1.7. Getting the Closest Match
        2. 41.1.2. Formatting Numbers
        3. 41.1.3. Formatting Dates
        4. 41.1.4. Formatting Currency
        5. 41.1.5. Localized String Comparison
        6. 41.1.6. Localized Capitalization
        7. 41.1.7. Error Handling
      2. 41.2. Accessibility
      3. 41.3. Color Correction
      4. 41.4. Summary
    2. 42. Deploying Flash on the Web
      1. 42.1. Embedding Flash in a Page
      2. 42.2. Embedding Flash Using SWFObject
      3. 42.3. Enabling Flash Player Options
        1. 42.3.1. Transparent Flash
        2. 42.3.2. Hardware Acceleration
        3. 42.3.3. Full-Screen Flash
      4. 42.4. Passing Variables to a SWF
      5. 42.5. Automatically Upgrading Flash Player
      6. 42.6. Summary
    3. 43. Interfacing with JavaScript
      1. 43.1. Using ExternalInterface
        1. 43.1.1. Calling JavaScript Functions from Flash
        2. 43.1.2. Calling ActionScript Functions from JavaScript
        3. 43.1.3. JavaScript Interaction and Flash Player Security
      2. 43.2. Making a Hybrid Application with ExternalInterface
      3. 43.3. Summary
    4. 44. Local Connections between Flash Applications
      1. 44.1. Local Connections and Their Uses
      2. 44.2. Implementing a Local Connection
        1. 44.2.1. The Sending Application
          1. 44.2.1.1. Sending Methods to a Receiving Application
          2. 44.2.1.2. Listening for the Status of Local Method Invocations
        2. 44.2.2. The Receiving Application
          1. 44.2.2.1. Assigning a Delegate
          2. 44.2.2.2. Listening to a Named Channel
          3. 44.2.2.3. Closing the Connection
      3. 44.3. Local Connections and the Security Policy
        1. 44.3.1. Specifying the Domain in the Sender
        2. 44.3.2. Removing the Domain from the Channel Name
        3. 44.3.3. Allowing Cross-Domain Local Connections from the Receiving Application
      4. 44.4. Example: Following the Mouse
      5. 44.5. Summary

Product information

  • Title: ActionScript 3.0 Bible
  • Author(s):
  • Release date: April 2010
  • Publisher(s): Wiley
  • ISBN: 9780470525234