Home
Contact Us
Sitemap
Available Categories
Adobe
Macromedia
Programming
SQL
Server Administration
Networking
Microsoft Products
Mac OS
Linux systems
Misc
Available Tutorials
.NET Framework Essentials
.NET Programming security
C# In A Nutshell Tutorial
Programming C.Sharp
Mastering Visual Studio .NET
ASP.NET
Web Solutions based on ASP.NET and ADO.NET
Java data objects
Java extreme programming
Java performance tuning
Java development on pda's. Building applications for pocket pc and palm devices
JavaScript and DHTML
Learning UML
UML
Learning XML
Cocoa
Programming Cpp
Perl objects, references and modules
Perl tutorial
Python tutorial
Python. Text processing
Pocket pc network programming
PHP & MySQL. Building web database applications
PHP & MySQL. Programming for beginners
PHP, MySQL and Apache in 24 hours
Software architecture in practice
Software engineering and computer games
Building Solutions With the Microsoft .NET Compact Framework
Programming Microsoft Visual C# 2005
Actionscript
Programming
>
Actionscript
Tutorial:
Actionscript
Please select a chapter from the "Contents" menu at the very bottom of the page.
Top
Actionscript
Preface
What's Not in This Book
Flash Naming Conventions
The Code
Typographical Conventions
We'd Like to Hear from You
Acknowledgments
Part I: Local Recipes
Chapter 1. ActionScript Basics
Introduction
Recipe 1.1 Using Mathematical Operators
Recipe 1.2 Checking Equality or Comparing Values
Recipe 1.3 Performing Actions Conditionally
Recipe 1.4 Performing Complex Conditional Testing
Recipe 1.5 Repeating an Operation Many Times
Recipe 1.6 Performing an Action Once per Frame Update
Recipe 1.7 Repeating a Task at Timed Intervals
Recipe 1.8 Creating Reusable Code
Recipe 1.9 Generalizing a Function to Enhance Reusability
Recipe 1.10 Exiting a Function
Recipe 1.11 Obtaining the Result of a Function
Recipe 1.12 Avoiding Conflicting Variables
Recipe 1.13 Reusing and Organizing Code in Multiple Movies
Chapter 2. Runtime Environment
Introduction
Recipe 2.1 Detecting the Player Version
Recipe 2.2 Detecting the Operating System
Recipe 2.3 Checking the System Language
Recipe 2.4 Detecting Display Settings
Recipe 2.5 Scaling the Movie
Recipe 2.6 Changing the Alignment
Recipe 2.7 Detecting the Device's Audio Capabilities
Recipe 2.8 Prompting the User to Change Player Settings
Recipe 2.9 Hiding the Flash Player's Menu Items
Recipe 2.10 Enhancing Standalone Projectors
Recipe 2.11 Setting the Dimensions of a Projector
Recipe 2.12 Specifying Where on Screen a Projector Opens
Chapter 3. Color
Introduction
Recipe 3.1 Setting the Color of a Movie Clip
Recipe 3.2 Specifying RGB Values
Recipe 3.3 Decoding an RGB Value
Recipe 3.4 Setting the RGB Relative to Its Current Value
Recipe 3.5 Tinting a Movie Clip's Color
Recipe 3.6 Setting a Movie Clip's Transparency
Recipe 3.7 Transforming a Movie Clip's Current Color
Recipe 3.8 Restoring a Movie Clip's Original Color
Recipe 3.9 Controlling a Movie Clip's Color with Sliders
Chapter 4. Drawing and Masking
Introduction
Recipe 4.1 Drawing a Line
Recipe 4.2 Drawing a Curve
Recipe 4.3 Drawing a Rectangle
Recipe 4.4 Drawing a Rounded Rectangle
Recipe 4.5 Drawing a Circle
Recipe 4.6 Drawing an Ellipse
Recipe 4.7 Drawing a Triangle
Recipe 4.8 Drawing Regular Polygons
Recipe 4.9 Filling a Shape with a Solid or Translucent Color
Recipe 4.10 Filling a Shape with a Gradient
Recipe 4.11 Filling a Shape with a Complex Gradient
Recipe 4.12 Scripting Masks
Chapter 5. Numbers and Math
Introduction
Recipe 5.1 Representing Numbers in Different Bases
Recipe 5.2 Converting Between Different Number Systems
Recipe 5.3 Rounding Numbers
Recipe 5.4 Inserting Leading or Trailing Zeros
Recipe 5.5 Formatting Numbers for Display
Recipe 5.6 Formatting Currency Amounts
Recipe 5.7 Generating a Random Number
Recipe 5.8 Simulating a Coin Flip
Recipe 5.9 Simulating Dice
Recipe 5.10 Simulating Playing Cards
Recipe 5.11 Generating a Unique Number
Recipe 5.12 Converting Angle Measurements
Recipe 5.13 Calculating the Distance Between Two Points
Recipe 5.14 Determining Points Along a Circle
Recipe 5.15 Converting Between Units of Measurement
Recipe 5.16 Calculating Asset Appreciation (Future Value)
Recipe 5.17 Calculating Retirement Savings
Recipe 5.18 Calculating the Loan (Mortgage) You Can Afford
Recipe 5.19 Calculating Loan Amortization or Annuities
Chapter 6. Arrays
Introduction
Recipe 6.1 Adding Elements to the Start or End of an Array
Recipe 6.2 Looping Through an Array
Recipe 6.3 Searching for Matching Elements in an Array
Recipe 6.4 Removing Elements
Recipe 6.5 Inserting Elements in the Middle of an Array
Recipe 6.6 Converting a String to an Array
Recipe 6.7 Converting an Array to a String
Recipe 6.8 Creating a Separate Copy of an Array
Recipe 6.9 Storing Complex or Multidimensional Data
Recipe 6.10 Sorting or Reversing an Array
Recipe 6.11 Implementing a Custom Sort
Recipe 6.12 Creating an Associative Array
Recipe 6.13 Reading Elements of an Associative Array
Chapter 7. Movie Clips
Introduction
Recipe 7.1 Referring to Movie Clips via ActionScript
Recipe 7.2 Targeting Movie Clips with Dynamic Names
Recipe 7.3 Affecting Playback
Recipe 7.4 Reversing Playback
Recipe 7.5 Using Movie Clips as Buttons
Recipe 7.6 Defining Hit Areas for Movie Clips
Recipe 7.7 Checking for Mouseover
Recipe 7.8 Performing Repeated Actions on Movie Clips
Recipe 7.9 Fading a Movie Clip
Recipe 7.10 Discovering Nested Movie Clips
Recipe 7.11 Getting Unique Depths
Recipe 7.12 Getting a Movie Clip's Boundaries
Recipe 7.13 Creating a Draggable Movie Clip
Recipe 7.14 Creating a Custom Mouse Pointer
Recipe 7.15 Checking for Overlapping Movie Clips (Performing Hit Tests)
Recipe 7.16 Changing Stacking Order
Recipe 7.17 Converting Between Coordinate Spaces
Recipe 7.18 Duplicating Movie Clips
Recipe 7.19 Adding Movie Clips from the Library with ActionScript
Chapter 8. Text
Introduction
Recipe 8.1 Referring to a Text Field via ActionScript
Recipe 8.2 Creating a Text Field
Recipe 8.3 Creating an Outline Around a Text Field
Recipe 8.4 Creating a Background for a Text Field
Recipe 8.5 Making a User Input Field
Recipe 8.6 Making a Password Input Field
Recipe 8.7 Filtering Text Input
Recipe 8.8 Restricting the Maximum Field Length
Recipe 8.9 Displaying Dynamic Text at Runtime
Recipe 8.10 Displaying HTML-Formatted Text
Recipe 8.11 Condensing Whitespace
Recipe 8.12 Sizing Text Fields to Fit Contents
Recipe 8.13 Scrolling Text with the ScrollBar Component
Recipe 8.14 Scrolling Text Programmatically
Recipe 8.15 Responding to Scroll Events
Recipe 8.16 Formatting Existing Text
Recipe 8.17 Formatting User-Input Text
Recipe 8.18 Formatting a Portion of a Text Field
Recipe 8.19 Setting a Text Field's Font
Recipe 8.20 Embedding Fonts
Recipe 8.21 Creating Text That Can Be Rotated
Recipe 8.22 Displaying Unicode Text
Recipe 8.23 Assigning Focus to a Text Field
Recipe 8.24 Selecting Text with ActionScript
Recipe 8.25 Setting the Insertion Point in a Text Field
Recipe 8.26 Responding When Text Is Selected or Deselected
Recipe 8.27 Responding to User Text Entry
Recipe 8.28 Adding a Hyperlink to Text
Chapter 9. Strings
Introduction
Recipe 9.1 Joining Strings
Recipe 9.2 Using Quotes and Apostrophes in Strings
Recipe 9.3 Inserting Special Whitespace Characters
Recipe 9.4 Searching for a Substring
Recipe 9.5 Extracting a Substring
Recipe 9.6 Matching Patterns with Regular Expressions
Recipe 9.7 Looking for a Pattern Match
Recipe 9.8 Parsing a String into Words
Recipe 9.9 Removing and Replacing Characters
Recipe 9.10 Processing One Character at a Time
Recipe 9.11 Converting Case
Recipe 9.12 Trimming Whitespace
Recipe 9.13 Reversing a String by Word or by Letter
Recipe 9.14 Converting Between Strings and Unicode or ASCII
Chapter 10. Dates and Times
Introduction
Recipe 10.1 Finding the Current Date and Time
Recipe 10.2 Retrieving the Day or Month Name
Recipe 10.3 Formatting the Date and Time
Recipe 10.4 Formatting Milliseconds as Minutes and Seconds
Recipe 10.5 Converting Between DMYHMSM and Epoch Milliseconds
Recipe 10.6 Calculating Elapsed Time or Intervals Between Dates
Recipe 10.7 Parsing a Date from a String
Recipe 10.8 Creating Timers and Clocks
Chapter 11. Forms
Introduction
Recipe 11.1 Adding UI Components at Runtime
Recipe 11.2 Positioning Form Elements
Recipe 11.3 Adding Menus to a Form
Recipe 11.4 Making Dependent Menus
Recipe 11.5 Resizing Menus to Fit Their Contents
Recipe 11.6 Detecting the Selected Menu Items
Recipe 11.7 Adding Radio Buttons to a Group
Recipe 11.8 Aligning Radio Buttons Automatically
Recipe 11.9 Getting the Selected Radio Button Value
Recipe 11.10 Adding Checkboxes to a Form
Recipe 11.11 Getting Checkbox Values
Recipe 11.12 Assembling an Advanced Form
Recipe 11.13 Submitting a Form
Recipe 11.14 Validating Form Input
Recipe 11.15 Alerting Users to Validation Errors
Recipe 11.16 Making a Multipage Form
Recipe 11.17 Submitting a Multipage Form
Recipe 11.18 Validating a Multipage Form
Recipe 11.19 Transmitting Data Securely
Recipe 11.20 Prepopulating a Form
Recipe 11.21 Customizing the Tab Order
Recipe 11.22 Using Tables to Arrange Form Elements
Recipe 11.23 Creating Auto-Complete Text Fields
Recipe 11.24 Customizing a Component's Appearance
Recipe 11.25 Customizing All Components' Appearances
Chapter 12. Objects and Custom Components
Introduction
Recipe 12.1 Using Methods and Properties of Built-in Objects
Recipe 12.2 Creating an Instance of a Class
Recipe 12.3 Adding Properties to an Object Instance
Recipe 12.4 Adding Custom Methods to an Object Instance
Recipe 12.5 Creating a Custom Class
Recipe 12.6 Creating Smart Getter/Setter Properties
Recipe 12.7 Defining Read-Only Properties
Recipe 12.8 Creating Subclasses
Recipe 12.9 Implementing Subclass Versions of Superclass Methods
Recipe 12.10 Listening for Events
Recipe 12.11 Adding Listeners to Custom Classes
Recipe 12.12 Creating a Component That Subclasses MovieClip
Recipe 12.13 Program: Color Selector Component
Chapter 13. Programming Sound
Introduction
Recipe 13.1 Creating an Object to Control Sound
Recipe 13.2 Attaching Sounds at Runtime
Recipe 13.3 Playing and Stopping a Sound
Recipe 13.4 Getting Playback Time
Recipe 13.5 Looping a Sound
Recipe 13.6 Setting In and Out Points
Recipe 13.7 Pausing and Resuming a Sound
Recipe 13.8 Performing Actions When a Sound Ends
Recipe 13.9 Queuing Sounds
Recipe 13.10 Adding Sounds to Buttons and UI Components
Recipe 13.11 Setting the Volume of a Sound
Recipe 13.12 Controlling the Panning of a Sound
Recipe 13.13 Creating Advanced Stereo Panning Effects
Recipe 13.14 Fading In a Sound
Recipe 13.15 Fading Out a Sound
Recipe 13.16 Program: A Sound Controller Component
Part II: Remote Recipes
Chapter 14. FlashCom Server
Introduction
Recipe 14.1 Creating a New FlashCom Application
Recipe 14.2 Connecting to the FlashCom Server
Recipe 14.3 Adding a Video Object at Runtime
Recipe 14.4 Capturing and Displaying Video from a Web Cam
Recipe 14.5 Capturing and Playing Audio from a Microphone
Recipe 14.6 Controlling FlashCom Audio
Recipe 14.7 Subscribing to Audio/Video Content
Recipe 14.8 Creating Playlists
Recipe 14.9 Recording and Publishing Video and Audio
Recipe 14.10 Publishing Live Content
Recipe 14.11 Pausing and Resuming a Net Stream
Recipe 14.12 Fast-Forwarding and Rewinding a Net Stream
Recipe 14.13 Seeking Relative to the Total Stream Length
Recipe 14.14 Implementing Server-Side ActionScript
Recipe 14.15 Tracking Clients Connected to the Application
Recipe 14.16 Invoking Server-Side Functions from the Client Movie
Recipe 14.17 Invoking Client-Side Functions from the Server
Chapter 15. Loading Assets
Introduction
Recipe 15.1 Loading an External SWF
Recipe 15.2 Loading an External SWF from a Trusting Domain
Recipe 15.3 Loading an External JPEG Image