Books & Videos

Table of Contents

  1. Local Recipes

    1. Chapter 1 ActionScript Basics

      1. Introduction
      2. Using Mathematical Operators
      3. Checking Equality or Comparing Values
      4. Performing Actions Conditionally
      5. Performing Complex Conditional Testing
      6. Repeating an Operation Many Times
      7. Performing an Action Once per Frame Update
      8. Repeating a Task at Timed Intervals
      9. Creating Reusable Code
      10. Generalizing a Function to Enhance Reusability
      11. Exiting a Function
      12. Obtaining the Result of a Function
      13. Avoiding Conflicting Variables
      14. Reusing and Organizing Code in Multiple Movies
    2. Chapter 2 Runtime Environment

      1. Introduction
      2. Detecting the Player Version
      3. Detecting the Operating System
      4. Checking the System Language
      5. Detecting Display Settings
      6. Scaling the Movie
      7. Changing the Alignment
      8. Detecting the Device’s Audio Capabilities
      9. Prompting the User to Change Player Settings
      10. Hiding the Flash Player’s Menu Items
      11. Enhancing Standalone Projectors
      12. Setting the Dimensions of a Projector
      13. Specifying Where on Screen a Projector Opens
    3. Chapter 3 Color

      1. Introduction
      2. Setting the Color of a Movie Clip
      3. Specifying RGB Values
      4. Decoding an RGB Value
      5. Setting the RGB Relative to Its Current Value
      6. Tinting a Movie Clip’s Color
      7. Setting a Movie Clip’s Transparency
      8. Transforming a Movie Clip’s Current Color
      9. Restoring a Movie Clip’s Original Color
      10. Controlling a Movie Clip’s Color with Sliders
    4. Chapter 4 Drawing and Masking

      1. Introduction
      2. Drawing a Line
      3. Drawing a Curve
      4. Drawing a Rectangle
      5. Drawing a Rounded Rectangle
      6. Drawing a Circle
      7. Drawing an Ellipse
      8. Drawing a Triangle
      9. Drawing Regular Polygons
      10. Filling a Shape with a Solid or Translucent Color
      11. Filling a Shape with a Gradient
      12. Filling a Shape with a Complex Gradient
      13. Scripting Masks
    5. Chapter 5 Numbers and Math

      1. Introduction
      2. Representing Numbers in Different Bases
      3. Converting Between Different Number Systems
      4. Rounding Numbers
      5. Inserting Leading or Trailing Zeros
      6. Formatting Numbers for Display
      7. Formatting Currency Amounts
      8. Generating a Random Number
      9. Simulating a Coin Flip
      10. Simulating Dice
      11. Simulating Playing Cards
      12. Generating a Unique Number
      13. Converting Angle Measurements
      14. Calculating the Distance Between Two Points
      15. Determining Points Along a Circle
      16. Converting Between Units of Measurement
      17. Calculating Asset Appreciation (Future Value)
      18. Calculating Retirement Savings
      19. Calculating the Loan (Mortgage) You Can Afford
      20. Calculating Loan Amortization or Annuities
    6. Chapter 6 Arrays

      1. Introduction
      2. Adding Elements to the Start or End of an Array
      3. Looping Through an Array
      4. Searching for Matching Elements in an Array
      5. Removing Elements
      6. Inserting Elements in the Middle of an Array
      7. Converting a String to an Array
      8. Converting an Array to a String
      9. Creating a Separate Copy of an Array
      10. Storing Complex or Multidimensional Data
      11. Sorting or Reversing an Array
      12. Implementing a Custom Sort
      13. Creating an Associative Array
      14. Reading Elements of an Associative Array
    7. Chapter 7 Movie Clips

      1. Introduction
      2. Referring to Movie Clips via ActionScript
      3. Targeting Movie Clips with Dynamic Names
      4. Affecting Playback
      5. Reversing Playback
      6. Using Movie Clips as Buttons
      7. Defining Hit Areas for Movie Clips
      8. Checking for Mouseover
      9. Performing Repeated Actions on Movie Clips
      10. Fading a Movie Clip
      11. Discovering Nested Movie Clips
      12. Getting Unique Depths
      13. Getting a Movie Clip’s Boundaries
      14. Creating a Draggable Movie Clip
      15. Creating a Custom Mouse Pointer
      16. Checking for Overlapping Movie Clips (Performing Hit Tests)
      17. Changing Stacking Order
      18. Converting Between Coordinate Spaces
      19. Duplicating Movie Clips
      20. Adding Movie Clips from the Library with ActionScript
    8. Chapter 8 Text

      1. Introduction
      2. Referring to a Text Field via ActionScript
      3. Creating a Text Field
      4. Creating an Outline Around a Text Field
      5. Creating a Background for a Text Field
      6. Making a User Input Field
      7. Making a Password Input Field
      8. Filtering Text Input
      9. Restricting the Maximum Field Length
      10. Displaying Dynamic Text at Runtime
      11. Displaying HTML-Formatted Text
      12. Condensing Whitespace
      13. Sizing Text Fields to Fit Contents
      14. Scrolling Text with the ScrollBar Component
      15. Scrolling Text Programmatically
      16. Responding to Scroll Events
      17. Formatting Existing Text
      18. Formatting User-Input Text
      19. Formatting a Portion of a Text Field
      20. Setting a Text Field’s Font
      21. Embedding Fonts
      22. Creating Text That Can Be Rotated
      23. Displaying Unicode Text
      24. Assigning Focus to a Text Field
      25. Selecting Text with ActionScript
      26. Setting the Insertion Point in a Text Field
      27. Responding When Text Is Selected or Deselected
      28. Responding to User Text Entry
      29. Adding a Hyperlink to Text
    9. Chapter 9 Strings

      1. Introduction
      2. Joining Strings
      3. Using Quotes and Apostrophes in Strings
      4. Inserting Special Whitespace Characters
      5. Searching for a Substring
      6. Extracting a Substring
      7. Matching Patterns with Regular Expressions
      8. Looking for a Pattern Match
      9. Parsing a String into Words
      10. Removing and Replacing Characters
      11. Processing One Character at a Time
      12. Converting Case
      13. Trimming Whitespace
      14. Reversing a String by Word or by Letter
      15. Converting Between Strings and Unicode or ASCII
    10. Chapter 10 Dates and Times

      1. Introduction
      2. Finding the Current Date and Time
      3. Retrieving the Day or Month Name
      4. Formatting the Date and Time
      5. Formatting Milliseconds as Minutes and Seconds
      6. Converting Between DMYHMSM and Epoch Milliseconds
      7. Calculating Elapsed Time or Intervals Between Dates
      8. Parsing a Date from a String
      9. Creating Timers and Clocks
    11. Chapter 11 Forms

      1. Introduction
      2. Adding UI Components at Runtime
      3. Positioning Form Elements
      4. Adding Menus to a Form
      5. Making Dependent Menus
      6. Resizing Menus to Fit Their Contents
      7. Detecting the Selected Menu Items
      8. Adding Radio Buttons to a Group
      9. Aligning Radio Buttons Automatically
      10. Getting the Selected Radio Button Value
      11. Adding Checkboxes to a Form
      12. Getting Checkbox Values
      13. Assembling an Advanced Form
      14. Submitting a Form
      15. Validating Form Input
      16. Alerting Users to Validation Errors
      17. Making a Multipage Form
      18. Submitting a Multipage Form
      19. Validating a Multipage Form
      20. Transmitting Data Securely
      21. Prepopulating a Form
      22. Customizing the Tab Order
      23. Using Tables to Arrange Form Elements
      24. Creating Auto-Complete Text Fields
      25. Customizing a Component’s Appearance
      26. Customizing All Components’ Appearances
    12. Chapter 12 Objects and Custom Components

      1. Introduction
      2. Using Methods and Properties of Built-in Objects
      3. Creating an Instance of a Class
      4. Adding Properties to an Object Instance
      5. Adding Custom Methods to an Object Instance
      6. Creating a Custom Class
      7. Creating Smart Getter/Setter Properties
      8. Defining Read-Only Properties
      9. Creating Subclasses
      10. Implementing Subclass Versions of Superclass Methods
      11. Listening for Events
      12. Adding Listeners to Custom Classes
      13. Creating a Component That Subclasses MovieClip
      14. Program: Color Selector Component
    13. Chapter 13 Programming Sound

      1. Introduction
      2. Creating an Object to Control Sound
      3. Attaching Sounds at Runtime
      4. Playing and Stopping a Sound
      5. Getting Playback Time
      6. Looping a Sound
      7. Setting In and Out Points
      8. Pausing and Resuming a Sound
      9. Performing Actions When a Sound Ends
      10. Queuing Sounds
      11. Adding Sounds to Buttons and UI Components
      12. Setting the Volume of a Sound
      13. Controlling the Panning of a Sound
      14. Creating Advanced Stereo Panning Effects
      15. Fading In a Sound
      16. Fading Out a Sound
      17. Program: A Sound Controller Component
  2. Remote Recipes

    1. Chapter 14 FlashCom Server

      1. Introduction
      2. Creating a New FlashCom Application
      3. Connecting to the FlashCom Server
      4. Adding a Video Object at Runtime
      5. Capturing and Displaying Video from a Web Cam
      6. Capturing and Playing Audio from a Microphone
      7. Controlling FlashCom Audio
      8. Subscribing to Audio/Video Content
      9. Creating Playlists
      10. Recording and Publishing Video and Audio
      11. Publishing Live Content
      12. Pausing and Resuming a Net Stream
      13. Fast-Forwarding and Rewinding a Net Stream
      14. Seeking Relative to the Total Stream Length
      15. Implementing Server-Side ActionScript
      16. Tracking Clients Connected to the Application
      17. Invoking Server-Side Functions from the Client Movie
      18. Invoking Client-Side Functions from the Server
    2. Chapter 15 Loading Assets

      1. Introduction
      2. Loading an External SWF
      3. Loading an External SWF from a Trusting Domain
      4. Loading an External JPEG Image
      5. Loading an External Image (All Formats)
      6. Loading an External MP3 Sound
      7. Loading Remote Content by Proxy
      8. Determining if an Asset Is Loaded
      9. Getting the Percentage of an Asset That Has Loaded
      10. Monitoring Load Progress Using a Progress Bar Component
      11. Monitoring Load Progress Without a Progress Bar Component
      12. Performing Actions When the Asset Is Loaded
      13. Hiding the Graphics and Text for a Progress Bar
    3. Chapter 16 Storing Persistent Information

      1. Introduction
      2. Storing and Retrieving Locally Persistent Information
      3. Adding Data to a Client-Side Shared Object
      4. Reading Values from a Client-Side Shared Object
      5. Saving a Local Shared Object
      6. Sharing Information Between Movies Within the Same Domain
      7. Storing Persistent Data on the Server
      8. Saving Remote Shared Object Data
      9. Checking for Updates to Remote Shared Objects
      10. Reading Values from a Server-Side Shared Object
      11. Adding Data to a Server-Side Shared Object
    4. Chapter 17 Communicating with Other Movies

      1. Introduction
      2. Communicating with Other Movieson the Same Computer
      3. Sending Data Using Local Connections
      4. Validating Receipt of Communication Over a Local Connection
      5. Accepting Communications from Other Domains
      6. Communicating Between Movies on Different Computers
      7. Broadcasting Data to Remote Shared Object Clients
    5. Chapter 18 Sending and Loading Variables

      1. Introduction
      2. Loading Variables from a Text File
      3. Loading Variables from a Server-Side Script
      4. Checking Load Progress
      5. Sending Data to a Server-Side Script
      6. Sending Variables and Handling a Returned Result
    6. Chapter 19 XML

      1. Introduction
      2. Understanding XML Structure (Reading and Writing XML)
      3. Creating an XML Object
      4. Adding Elements to an XML Object
      5. Adding Text Nodes to an XML Object
      6. Creating an XML Object from an Array
      7. Adding Attributes to an XML Element
      8. Reading Elements in an XML Tree
      9. Finding Elements by Name
      10. Reading Text Nodes and Their Values
      11. Reading an Element’s Attributes
      12. Loading XML
      13. Removing Extra Whitespace from XML Objects
      14. Sending XML
      15. Sending XML Data and Receiving a Response
      16. Searching XML
      17. Using XML Data to Initialize a Movie
    7. Chapter 20 Flash Remoting

      1. Introduction
      2. Establishing a Connection via Flash Remoting
      3. Configuring Flash Remoting for ColdFusion
      4. Configuring Flash Remoting for .NET
      5. Configuring Flash Remoting for J2EE
      6. Configuring Flash Remoting for PHP or Perl
      7. Invoking a Remote Function on a Service
      8. Handling Flash Remoting Results
      9. Distinguishing Among Results from Multiple Calls to a Single Service
      10. Calling ASP.NET Functions from Flash
      11. Calling ColdFusion Functions from Flash
      12. Passing Named Parameters to ColdFusion Component Methods
      13. Passing Complex Parameters to ColdFusion Component Methods
      14. Calling Java or JSP Functions from Flash
      15. Transmitting Custom Datatypes to a Flash Remoting Back End
      16. Receiving Typed Objects with ColdFusion
      17. Receiving Typed Objects with ASP.NET
      18. Receiving Typed Objects with Java
      19. Returning Typed Objects from ColdFusion
      20. Returning Typed Objects from ASP.NET
      21. Returning Typed Objects from Java
      22. Writing Server-Side Functions in ActionScript
      23. Querying a Database with Server-Side ActionScript
      24. Making HTTP Requests with Server-Side ActionScript
      25. Consuming Web Services with Flash Remoting for .NET or ColdFusion
    8. Chapter 21 Recordsets

      1. Introduction
      2. Creating Recordsets
      3. Reading Recordsets
      4. Filtering Recordsets
      5. Sorting Recordsets by a Single Column
      6. Populating Menu Components
      7. Using Recordsets with DataGrids
  3. Applications

    1. Chapter 22 Building a Flash Paint Application

      1. Planning the Application
      2. Building the Components
      3. Assembling the Flash Paint Application
      4. Using Flash Paint
    2. Chapter 23 Creating a Simple Animation in Stages

      1. Stage One
      2. Stage Two
      3. Stage Three
      4. Stage Four
      5. Stage Five
      6. Conclusion
    3. Chapter 24 Video Chat/Message Center

      1. Developing the Application Overview
      2. Creating the Server-Side Application
      3. Creating the Calling Client
      4. Creating the Administrator Client
      5. Putting It All Together
    4. Chapter 25 Image Viewer/Slideshow

      1. Planning the Application Design
      2. Beginning the Application
      3. Creating the Components
      4. Putting Together the Application
      5. Wrapping It Up
    5. Chapter 26 Creating an MP3 Jukebox

      1. Creating an Application Overview
      2. Developing the MP3 Selectors
      3. Developing the Jukebox Application
      4. Wrapping It Up
    6. Chapter 27 A Personalized My Page Application

      1. Formulating the Application Overview
      2. Creating the Framework
      3. Creating Service Modules
      4. Putting It All Together
      5. Extending the Framework
      6. Wrapping It Up
    7. Chapter 28 A Scheduler Program

      1. Designing the Application Structure
      2. Making the Components
      3. Putting the Application Together
      4. Making the Scheduler Application Available Online
      5. Using LoadVars and XML
      6. Wrapping It Up
  1. Appendix Unicode Escape Sequences for Latin 1 Characters

  2. Colophon