ActionScript™ 3.0 Bible

Book description

Packed with hands-on instruction and step by step tutorials, the ActionScript 3 Bible is everything you need to harness the power of this amazing language. ActionScript experts Roger Braunstein and Mims Wright guide you through the in's and out's of building Rich Internet Applications with ActionScript 3. Coverage includes:
* The ActionScript 3 language - variables, datatypes, operators and expressions, functions, and more
* Object-Oriented aspects of ActionScript 3
* Working with XML
* Dealing with events
* Handling error events and making your applications fault tolerant
* Debugging ActionScript applications
* Loading external data
* Working with audio, video and graphics
* Working in binary
* Developing for Apollo
* Application deployment
And more...

Table of contents

  1. Copyright
  2. Dedication
  3. About the Authors
  4. Acknowledgments
    1. Acknowledgments
  5. Introduction
    1. ActionScript and the Flash Bible Series
    2. Who Should Read This Book
    3. How This Book Is Organized
      1. Part I: Getting Started with ActionScript 3.0
      2. Part II: Working with ActionScript 3.0 Objects
      3. Part III: Working with the Display List
      4. Part IV: Understanding the Event Framework
      5. Part V: Working with Error Handling
      6. Part VI: Working with External Data
      7. Part VII: Enriching Your Program with Sound and Video
      8. Part VIII: Programming Graphics and Motion
      9. Part IX: Working with Binary Data
      10. Part X: Deploying Your Program
    4. Conventions and Features
      1. Callouts
      2. Code Formatting and Conventions
    5. What's on the Companion Web Site
    6. Minimum Requirements
    7. Running Code in This Book
      1. Adobe Flash CS3 Professional
        1. Running a Snippet
      2. Adobe Flex Builder 2
      3. For More Information
    8. Where to Go from Here
  6. 1. Getting Started with ActionScript 3.0
    1. 1. Introducing ActionScript 3.0
      1. Introduction
      2. What Is ActionScript?
      3. Where Can You Use ActionScript?
      4. What's New in ActionScript 3.0?
        1. Display List
        2. Runtime Errors
        3. Runtime Data Types
        4. Method Closures
        5. Intrinsic Event Model
        6. Regular Expressions
        7. E4X
      5. Summary
    2. 2. Understanding ActionScript 3.0 Language Basics
      1. Introduction
      2. Using Variables
        1. Anatomy of a variable declaration
        2. Constants in this changing world
        3. Taking it literally
      3. Using Access Controls
      4. Introducing Scope
        1. Types of scope
          1. Global scope
          2. Local scope
            1. Class level (static) variables and methods
            2. Instance level variables and methods
            3. Function‐level variables and functions
            4. Block‐level variables
        2. The scope chain
          1. Overriding variables
        3. Working with scope
          1. Does the variable pertain to the class or to an instance of a class?
          2. Will I need this object after the function is complete? Do I need to save changes to this variable?
      5. Introducing the Data Types
        1. Declaring types
        2. Using untyped variables with the wildcard (*) data type
      6. Working with Operators
        1. Unary vs. binary operators
        2. Order of operations
        3. Some commonly used operators
          1. Arithmetic (+, ‐, *, /)
          2. Modulo (%)
          3. Increment (++) and decrement (– –)
          4. Compound Assignment operators (+=, ‐=, *=, /=, and %=)
      7. Making Logical Choices with Conditionals
        1. If statements
          1. Equality (==)
        2. Testing other comparisons
          1. Greater than (>) and less than (<)
          2. Not equal to (!=)
          3. And (&&) and Or (||) operators
          4. Checking for null values
          5. Using other Boolean values
        3. if..else
        4. switch
        5. The conditional operator
      8. Repeating Actions Using Loops
        1. Using for loops
        2. Using for..in and for each..in
          1. for..in
          2. for each..in
        3. Using while and do..while
          1. do..while
        4. Using for vs. using while
          1. Avoiding infinite loops
        5. Using break and continue
          1. continue
          2. Break
      9. Commenting Your Code
        1. Types of comments
          1. Single line comment
          2. Block comments
          3. XML comments
        2. When to use comments
          1. Self‐commenting code
      10. Summary
    3. 3. Programming with Classes
      1. Introduction
      2. Understanding Classes
        1. Classes can model the real world
        2. Classes contain data and operations
        3. Classes separate responsibilities
        4. Classes are types
        5. Classes contain your program
      3. Understanding Terminology
        1. Object
        2. Class
        3. Instance
        4. Type
      4. Understanding Encapsulation
        1. The black box principle
        2. Encapsulation and polymorphism
      5. Understanding Packages
        1. Class uniqueness
        2. Hierarchy
        3. Controlling visibility
        4. Code allowed in packages
        5. Using code from packages
      6. Using Inheritance
        1. Structuring code with inheritance
        2. Inheritance, types, and polymorphism
        3. Inheritance vs. composition
        4. Preventing inheritance
      7. Using Access Control Attributes with Classes
        1. Public and private
        2. Protected
        3. Internal
        4. Namespaces
      8. Using Methods in Classes
        1. Constructors
      9. Using Properties in Classes
        1. Accessors
        2. Avoid side effects
      10. Overriding Behavior
        1. Using the base class
      11. Using Static Methods and Properties
        1. Static variables
        2. Static constants
          1. Enumerations
        3. Static methods
          1. Static accessors
      12. Designing Interfaces
      13. Manipulating Types
        1. Type compatibility and coercion
        2. Explicit type conversion
        3. Determining types
      14. Creating Dynamic Classes
      15. Summary
    4. 4. Working with Methods and Functions
      1. Introduction
      2. Understanding Functions
        1. Understanding the difference between methods and functions
        2. Calling a function
          1. Calling functions vs. calling methods
      3. Creating Custom Functions
        1. Defining a function
        2. Passing parameters to your function
          1. Passing by reference or by value
          2. Setting default values
          3. Using the rest argument (...)
        3. Accessing the Arguments object
          1. Extracting values from the arguments property
      4. Returning Results
        1. Returning a value using a return statement
          1. Defining a return type for your function
          2. Returning void
      5. Defining Functions Using Function Expressions
      6. Accessing the Methods of a Superclass
        1. Overriding methods
        2. Writing Recursive Functions
        3. Curing recursivitis
      7. Functions as Objects
        1. function vs. Function
        2. Methods and properties of the Function class
      8. Summary
    5. 5. Validating Your Program
      1. Introduction
      2. Introducing Errors
        1. Compile‐time errors vs. runtime errors
          1. Compile‐time errors
          2. Runtime errors
        2. Warnings
        3. Getting feedback from Flash CS3 and Flex Builder
          1. Debugging in Flash CS3
          2. Debugging in Flex Builder
      3. Fixing Errors
        1. Common types of errors
      4. Summary
  7. 2. Working with ActionScript 3.0 Objects
    1. 6. Using Strings
      1. Introduction
        1. Working with string primitives
          1. Converting a string object to a primitive
          2. Using escaped characters
        2. Converting to and from strings
          1. Using toString
          2. Casting to a string
          3. Converting strings into other types
            1. Converting strings to arrays
        3. Combining strings
        4. Converting the case of a string
        5. Using the individual characters in a string
          1. Getting the number of characters in a string
          2. Getting a particular character
          3. Converting a character to a character code
        6. Searching within a string
          1. Searching by substring
          2. Searching with Regular Expressions
        7. Chopping up your strings
      2. Summary
    2. 7. Working with Numbers and Math
      1. Introduction
      2. Understanding Numeric Types
        1. Sets of numbers
        2. Representing numbers
        3. Digital representations of numbers
          1. Unsigned integers
          2. Signed integers
          3. Floating‐point numbers
      3. Using Numbers in ActionScript
        1. Number
        2. int
        3. uint
        4. Literals
        5. Edge cases
          1. Not a number
          2. Infinity
          3. Minimum and maximum values
      4. Manipulating Numbers
        1. Numeric conversions
        2. String conversions
      5. Performing Arithmetic
      6. Performing Trigonometric Calculations
      7. Generating Randomness
      8. Manipulating Dates and Times
        1. Creating a date
        2. Epoch time
        3. Time zones
        4. Accessing and modifying a date
        5. Date arithmetic
        6. Execution time
        7. Formatting a date
      9. Summary
    3. 8. Using Arrays
      1. Introduction
      2. Array Basics
        1. Using the Array constructor
        2. Creating an array by using an array literal
        3. Referencing values in an array
        4. Finding the number of items in an array
      3. Converting Arrays to Strings
      4. Adding and Removing Items from an Array
        1. Appending values to the end of your array with concat()
        2. Applying stack operations push() and pop()
        3. Applying queue operations shift() and unshift()
      5. Slicing, Splicing, and Dicing
        1. Inserting and removing values with splice()
        2. Working with a subset of your array with slice()
      6. Iterating Through the Items in an Array
        1. Using a for loop
        2. Using the forEach() method
      7. Searching for Elements
      8. Reordering Your Array
        1. Flipping the order of your array using reverse()
        2. Using sorting functions
      9. Applying Actions to All Elements of an Array
        1. Conditional processing with every(), some(), and filter()
        2. Getting results with the map() method
      10. Alternative Types of Arrays
        1. Working with associative arrays
        2. Using an object as a lookup key with dictionaries
        3. Using Multidimensional arrays
      11. Summary
    4. 9. Using Objects
      1. Introduction
      2. Working with Objects
        1. Dynamic classes
        2. Creating objects
        3. Accessing object properties
        4. toString()
      3. Using Objects as Associative Arrays
        1. Comparing Arrays, Objects, and Dictionaries
        2. Testing for existence
        3. Removing properties
        4. Iterating
      4. Using Objects for Named Arguments
      5. Using Objects as Nested Data
        1. XML as Objects
        2. JSON
      6. Summary
    5. 10. Working with XML
      1. Introduction
      2. Getting Started with XML in ActionScript
        1. Origins of E4X
        2. Working with XML literals
          1. Using expressions within literals
        3. A brief introduction to E4X operators and syntax
        4. Understanding the XML classes
          1. XML
          2. XMLList
          3. Namespace
          4. QName
      3. Accessing Values with E4X
        1. Using the dot operator to access Elements
          1. Using methods to access children
        2. Using the at operator to access attributes
        3. Accessing text within an element
        4. Using the descendant accessor
        5. Accessing ancestors
        6. Iterating through the children of an element
        7. Filtering within XML
      4. Constructing XML objects
        1. Combining XML nodes
          1. Using + and += operators
          2. Using XML methods to combine values
        2. Removing XML nodes
        3. Duplicating an XML object
        4. Replacing values in XML nodes
      5. Converting to and from Strings
        1. Converting strings to XML
        2. Converting XML to strings
          1. Printing pretty
          2. Setting the number of spaces per indentation
          3. Normalizing text nodes
      6. Loading XML Data from External Sources
      7. Gathering Meta‐Information About XML Nodes
        1. Finding node types
        2. Determining the type of content in a node
      8. Using Namespaces
        1. Working with namespaces in ActionScript
          1. Using the :: operator
        2. Taking it further
      9. Working with Comments and Processing Instructions
      10. Setting Options for the XML class
      11. Summary
    6. 11. Working with Regular Expressions
      1. Introduction
      2. Introducing Regular Expressions
        1. Writing a regular expression
      3. Applying Regular Expressions
        1. String methods and RegExp methods
        2. Testing
          1. RegExp.test(str:String):Boolean
        3. Locating
          1. String.search(pattern:*):int
          2. RegExp.exec(str:String):Object
        4. Identifying
          1. RegExp.exec(str:String):Object
          2. String.match(pattern:*):Array
        5. Extracting
          1. String.match(pattern:*):Array
          2. RegExp.exec(str:String):Object
        6. Replacing
          1. String.replace(pattern:*, repl:Object):String
        7. Splitting
          1. String.split(delimiter:*, limit:Number = 0x7fffffff):Array
      4. Constructing Expressions
        1. Normal characters
        2. Dot character
        3. Escaped characters
        4. Metacharacters and metasequences demystified
        5. Character classes
        6. Quantifiers
        7. Anchors and boundaries
        8. Alternation
        9. Groups
      5. Understanding Regular Expression Flags
        1. Global
        2. Ignore case
        3. Multiline
        4. Dotall
        5. Extended
      6. Constructing Advanced Expressions
        1. Greedy and lazy matching
        2. Backreferences
        3. Lookahead and non‐capturing groups
          1. Non‐capturing groups
          2. Positive lookahead groups
          3. Negative lookahead groups
        4. Named groups
        5. International concerns
      7. Using the RegExp Class
        1. Building dynamic expressions with String operations
        2. RegExp public properties
      8. Summary
  8. 3. Working with the Display List
    1. 12. Understanding the Flash Player 9 Display List
      1. Introduction
      2. Display List
      3. DisplayObject and DisplayObjectContainer
        1. What is an abstract class?
        2. Understanding the x and y position of a DisplayObject
        3. The DisplayObjects stage
        4. Transform
        5. Sizing the DisplayObject
        6. Using the blend mode
      4. Introducing the Graphics Object
        1. Creating fills
        2. Drawing lines in a graphics object
        3. Drawing curves in a graphics object
      5. Working with the Stage
        1. Using the stageResize event
        2. Setting the Stage alignment and scale mode
      6. InteractiveObject and SimpleButton
        1. SimpleButton
        2. Tab‐enabled interactive objects
        3. Focus and Tab Events
        4. Mouse properties
        5. Events that the InteractiveObject receives
      7. Shape
      8. Creating User Interface Elements with Sprite
        1. Dragging and dropping
        2. Using the buttonMode of the Sprite
        3. Using the hitArea
        4. Using hitTestPoint
        5. Swapping the depths of children
        6. Reparenting display objects
      9. Working with the MovieClip
        1. Using stop() and gotoAndPlay()
        2. Checking totalFrames and framesLoaded
      10. Examples using the Display List
        1. Creating an item renderer
        2. Creating a bouncing ball
        3. Checking for collisions
      11. Summary
    2. 13. Working with DisplayObjects in Flash CS3
      1. Introduction
      2. Creating Symbols Within Flash CS3
        1. Setting the variable name of your symbol on the stage
        2. Using a custom class for your symbol
        3. Embedding bitmap graphics assets into your program
        4. Using Flex to embed graphics
      3. Accessing Embedded Graphic Classes
      4. Summary
    3. 14. Printing
      1. Introduction
      2. Why Print from Flash?
      3. Controlling Printer Output from Flash
        1. Introducing the PrintJob class
        2. Starting a print request
        3. Determining the print target and its formatting options
          1. Printing targets as vectors
          2. Printing targets as bitmaps
          3. Controlling the printable area of the target
        4. Potential issues with the Flash‐printed output
      4. Adding Print Functionality to Applications
      5. Summary
    4. 15. Working with Text and Fonts
      1. Introduction
      2. Introducing TextFields
        1. Creating a new TextField
        2. Adding new text to a TextField
        3. Setting a TextField's size
        4. Setting a TextField's scaling and rotation
        5. Retrieving strings from a TextField
        6. Displaying HTML
        7. Adding images or SWF files to a TextField with <img>
        8. Using the StyleSheet with a TextField
        9. Creating backgrounds for a TextField
      3. Using TextFormat
        1. Creating and applying a TextFormat to a TextField
          1. align
          2. blockIndent
          3. bold
          4. bullet
          5. color
          6. font
          7. Indent
          8. italic
          9. Leading
          10. leftMargin
          11. rightMargin
          12. size
          13. tabStops
          14. target
          15. underline
          16. url
      4. More Advanced Control Over Text
        1. Embedding fonts and using AntiAlias
        2. Using gridFitType
        3. Using the numLines and wordwrap properties
        4. Altering or restricting characters for a text field
        5. Using the scroll properties
        6. Using multiline and TextMetrics
        7. Displaying Unicode
      5. Creating Text Input fields
        1. Making a TextField an input field
        2. Using tabs with an input TextField
      6. Listening to TextField events
        1. textInput event
        2. change and scroll event
        3. focusIn and focusOut events
        4. link events
      7. Summary
  9. 4. Understanding the Event Framework
    1. 16. Understanding Events
      1. Introduction
      2. Introducing Events
        1. Saturday morning events
        2. Event terminology
          1. event
          2. type
          3. target
          4. dispatcher
          5. listener
          6. handler
          7. flow
          8. phase
      3. Understanding EventDispatcher
        1. Using EventDispatcher
        2. Using EventDispatcher by composition
      4. Working with Event Objects
        1. Creating a new event
      5. Adding and Removing Event Listeners
        1. type
        2. listener
        3. useCapture
        4. priority
        5. useWeakReference
        6. Removing a listener from a dispatcher
      6. Understanding Event Flow
        1. The phases of event flow
          1. Capture phase
          2. Target phase
          3. Bubble phase
        2. Event flow in action
      7. Preventing Default Behaviors
      8. Summary
    2. 17. Working with Mouse and Keyboard Events
      1. Introduction
      2. MouseEvent Basics
      3. Local and Stage Coordinates
      4. Other MouseEvent Properties
      5. MouseEvent Types
        1. MouseEvent.CLICK
        2. MouseEvent.DOUBLE_CLICK
        3. MouseEvent.MOUSE_DOWN
        4. MouseEvent.MOUSE_MOVE
        5. MouseEvent.MOUSE_OUT
        6. MouseEvent.MOUSE_OVER
        7. MouseEvent.MOUSE_UP
        8. MouseEvent.MOUSE_WHEEL
        9. MouseEvent.ROLL_OUT
        10. MouseEvent.ROLL_OVER
        11. FocusEvent.MOUSE_FOCUS_CHANGE
      6. Using MouseEvent in Conjunction with the Mouse
      7. KeyboardEvent Basics
      8. KeyboardEvent Types
        1. FocusEvent.KEY_FOCUS_CHANGE
      9. Understanding keyCodes
      10. IMEEvents
      11. Summary
    3. 18. Using Timers
      1. Introduction
      2. Timer Basics
        1. Creating a timer
        2. Listening for timer events
        3. Starting, stopping, and resetting the timer
      3. Handling the TimerEvent
        1. Getting a reference to the timer
        2. Delaying the execution of a function
      4. Creating a World Clock
        1. Bonus
      5. Legacy Timer Functions
        1. Using getTimer()
      6. Summary
  10. 5. Working with Error Handling
    1. 19. Understanding Errors
      1. Introduction
      2. Comparing Ways to Fail
      3. Understanding Exceptions
        1. Throwing exceptions
        2. Catching exceptions
        3. The exception flow
        4. Uncaught exceptions
        5. finally
        6. Rethrowing exceptions
      4. Catching Errors Generated by Flash
      5. Custom Exceptions
      6. Handling Asynchronous Errors
      7. Summary
    2. 20. Using the AVM2 Debugger
      1. Introduction
      2. Introducing Debugging
      3. Launching the Debugger
        1. Starting and stopping the Flash CS3 debugger
        2. Starting and stopping the Flex Builder 2 debugger
        3. Debuggers compared
      4. Taking Control of Execution
        1. Stopping at an uncaught exception
        2. Stopping at a breakpoint
        3. Stopping on demand
      5. Pulling Back the Curtain
        1. Interpreting the Variables panel
        2. Flex Builder Variables panel and watches
      6. Navigating Through Code
        1. Continue
        2. The call stack
        3. Step into
        4. Step over
        5. Step out/return
      7. Debugging a Simple Example
      8. Using the Debugger Effectively
      9. Summary
    3. 21. Making Your Application Fault‐Tolerant
      1. Introduction
      2. Developing a Strategy
      3. Determining What Errors to Handle
      4. Categorizing Failures
      5. Logging Errors
      6. Messaging the User
      7. Degrading Styles: An Example
      8. Summary
  11. 6. Working with External Data
    1. 22. Understanding Networking Basics
      1. Introduction
      2. URLRequest
        1. navigateToURL()
        2. GET and POST
      3. URLLoader
        1. URLLoader basics
        2. Doing more with the URLLoader
        3. Introducing URLVariables
        4. URLStream
        5. sendToURL()
      4. Using the Loader
        1. Understanding Flash Player Security
      5. Summary
    2. 23. Communicating with Server‐Side Technologies
      1. Introduction
      2. Communicating via URLLoader
      3. Using PHP to communicate with Flash
        1. Sending data without loading it
      4. XMLSocket
        1. Creating an XMLSocket object
        2. The server side of an XMLSocket
      5. Flash Remoting
        1. NetConnection
        2. Responder
        3. Flash Remoting server solutions
      6. Summary
    3. 24. Saving Data to a Local Machine Using SharedObject
      1. Introduction
      2. Comparing Approaches to Persistent Storage
        1. Storing information in a local shared object
        2. Storing information on a server
        3. Storing information in a browser cookie
      3. Identifying Useful Situations for Shared Objects
      4. Using SharedObjects
        1. Retrieving a SharedObject
        2. Reading from, and writing to, a SharedObject
        3. Deleting information from a SharedObject
        4. Saving information
      5. Sharing Information Between SWFs
        1. Requiring a secure connection
        2. Sharing with ActionScript 1.0 and 2.0 SWFs
      6. Working with Size Constraints
        1. User settings
        2. User requests
        3. Asking for space before it's too late
        4. Asking for space up front
        5. Using flush()
        6. Viewing used space
      7. Storing Custom Classes
        1. Storing custom classes without modification
        2. Creating self‐serializing classes
      8. Using Serialization Concepts for Remoting
      9. Summary
    4. 25. Managing File Uploads and Downloads
      1. Introduction
      2. Introducing FileReference
      3. Uploading Files
        1. Selecting a file to upload
        2. Determining when a file is selected
        3. Retrieving file properties
        4. Uploading a file
      4. Adding Uploading Capabilities to an Application
      5. Downloading a File
      6. Summary
  12. 7. Enriching Your Program with Sound and Video
    1. 26. Working with Sound
      1. Introduction
      2. How Sound Works in AS3
        1. Learning the AS3 sound classes
        2. Working with sound events
      3. Creating a Sound Object
        1. Loading a sound from an external file or URL
          1. Buffering a streaming sound
        2. Embedding sounds into your program
          1. Using Flash CS3 to embed sounds
          2. Using Flex to embed sounds
          3. Accessing embedded sounds
      4. Controlling Playback of a Sound
        1. Playing and stopping a sound
        2. Setting the start point and number of loops of a sound
        3. Fast‐forwarding, rewinding, pausing, and restarting a sound
      5. Applying Sound Transformations
        1. Changing the volume and panning of a sound
      6. Working with a Sound's Metadata
        1. Checking the file size of a sound
        2. Getting a song's ID3 data
      7. Calculating Spectrum Data
      8. Detecting Audio Capabilities
      9. Summary
    2. 27. Adding Video
      1. Introduction
      2. Working with Flash Video Files
        1. Making an FLV file with the Flash Video Encoder
        2. Using RTMP to access FLV files
        3. Using HTTP to access FLV files
      3. Understanding the Video and NetStream Classes
      4. Loading FLV Files into a Flash Movie
        1. Building an HTTP connection to an FLV file
        2. Displaying the NetStream data in a Video object
        3. Checking status messages from the NetStream class
        4. Retrieving metadata
      5. Building an FLV Playback Application
      6. Summary
    3. 28. Accessing Microphones and Cameras
      1. Introduction
      2. Introducing the Camera
        1. Attaching the camera to a video
      3. Introducing the Microphone
        1. Working with the microphone
      4. Media Servers
      5. Summary
  13. 8. Programming Graphics and Motion
    1. 29. Applying Filters to Your Graphics
      1. Introduction
      2. Introducing Filters
      3. Applying Filters
        1. Blur filters
        2. Adding the drop shadow filter
        3. Bevel filters
        4. Glow filtering
        5. Adding the gradient bevel filter
        6. Convolution filtering
          1. Applying a digital negative
          2. Applying a grayscale
          3. Applying saturation changes
          4. Applying tint
          5. Applying brightness
          6. Applying contrast
        7. Adding the convolution filter
        8. Gradient glow filtering
        9. Displacement filtering
      4. Adding More Than One Filter
      5. Rotating Objects with Filters
      6. Summary
    2. 30. Drawing Vector Graphics Programmatically
      1. Introduction
      2. Lines and LineStyles
        1. Setting a line style
        2. Moving the pen without drawing
        3. Drawing a straight line
        4. Drawing a curve
        5. Adding a simple one‐color fill
        6. Adding a bitmap fill
        7. Working with gradients
          1. Applying gradients to lines
          2. Applying gradient fills
        8. Clearing previously drawn graphics
      3. Creating Shapes
        1. Drawing circles
        2. Drawing ellipses
        3. Drawing rounded rectangles
        4. Filling shapes
      4. Masks
        1. Advanced masks
      5. Making a Drawing Application
      6. Summary
    3. 31. Scripting Animation
      1. Introduction
      2. Understanding Flash Player and Animation
        1. Frame rate
        2. Flash Player operation
      3. Animating with Pure ActionScript
        1. Animating by time
        2. Animating by frames
        3. Animation and speed
      4. Animating Using Flash
        1. Review: tweens, keyframes, and easing
        2. Introducing motion XML
          1. The Motion object
          2. The Source object
          3. The Keyframe Object
          4. The Color Object
          5. Filter Objects
          6. The ITween Objects
        3. Using the Flash motion package
      5. Animating Using Flex
      6. Choosing a Third‐Party Animation Toolkit
        1. Flash motion package
        2. Tweener
        3. AnimationPackage
      7. Summary
    4. 32. Applying Transformations to Graphics
      1. Introduction
      2. Working with Matrix Transforms
        1. Using matrix transformations
      3. Working with Color Transforms
        1. Applying color transforms
        2. Getting and setting the color
        3. Tinting a display object
        4. Resetting colors
        5. Transforming colors
      4. Summary
    5. 33. Drawing Bitmap Graphics Programmatically
      1. Introduction
      2. Creating a BitmapData Object
        1. Using the constructor method
        2. Creating instances of embedded assets
        3. Displaying BitmapData images
          1. Pixel snapping
          2. Image smoothing
      3. Working with BitmapData Properties
      4. Copying Images
        1. Copying from display objects
        2. Loading BitmapData images
        3. Copying from BitmapData objects
          1. Cloning a BitmapData object
          2. Drawing into a BitmapData object
          3. Copying pixels
          4. Copying channels
          5. Merging BitmapData images
          6. Getting and setting pixels
      5. Applying Color Transformations
      6. Applying Fills
        1. Applying rectangular fills
        2. Applying flood fills
      7. Detecting Areas by Color
      8. Applying Effects
        1. Replacing colors with threshold
        2. Using pixel dissolves
        3. Remapping the color palette
      9. Making Noise
        1. Adding noise
        2. Adding Perlin noise
      10. Applying Filters
      11. Summary
  14. 9. Working with Binary Data
    1. 34. Working with Binary Data
      1. Introduction
      2. Creating a Byte Array
      3. Writing to a Byte Array
      4. Reading from a Byte Array
      5. Common Uses of Byte Arrays
        1. Computing sound spectrums
        2. Loading images
        3. Copying objects
        4. Custom serialization of data
        5. Working with binary sockets
          1. Connection to the server
          2. Listen for messages
          3. Send messages to the server
          4. Disconnect from the server
          5. Building applications using sockets
      6. Summary
  15. 10. Deploying Your Program
    1. 35. Deploying Flash on the Web
      1. Introduction
      2. Embedding Flash in a Page
      3. Embedding Flash Using SWFObject
      4. Enabling Flash Player Options
        1. Transparent Flash
        2. Full‐Screen Flash
      5. Passing Variables to a SWF
      6. Automatically Upgrading Flash Player
      7. Summary
    2. 36. Interfacing with JavaScript
      1. Introduction
      2. Communicating Between JavaScript and Flash
        1. Using ExternalInterface
          1. Calling JavaScript functions from Flash
          2. Calling ActionScript functions from JavaScript
          3. Making an integrated HTML/Flash application with ExternalInterface
      3. Summary
    3. 37. Using Local Connections to Communicate Between Flash Applications
      1. Introduction
      2. Creating a Sending Application
        1. Sending parameters
        2. Checking the status of a send
      3. Creating a Receiving Application
      4. Sending and Receiving Across Domains
        1. The sending application
        2. The receiving application
      5. Summary

Product information

  • Title: ActionScript™ 3.0 Bible
  • Author(s): Roger Braunstein, Mims H. Wright, Joshua J. Noble
  • Release date: October 2007
  • Publisher(s): Wiley
  • ISBN: 9780470135600