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