Book description
ActionScript 3.0 is a huge upgrade to Flash's programming language. The enhancements to ActionScript's performance, feature set, ease of use, cleanliness, and sophistication are considerable. Essential ActionScript 3.0 focuses on the core language and object-oriented programming, along with the Flash Player API. Essential ActionScript has become the #1 resource for the Flash and ActionScript development community, and the reason is the author, Colin Moock. Many people even refer to it simply as "The Colin Moock book."
And for good reason: No one is better at turning ActionScript inside out, learning its nuances and capabilities, and then explaining everything in such an accessible way. Colin Moock is not just a talented programmer and technologist; he's also a gifted teacher.
Essential ActionScript 3.0 is a radically overhauled update to Essential ActionScript 2.0. True to its roots, the book once again focuses on the core language and object-oriented programming, but also adds a deep look at the centerpiece of Flash Player's new API: display programming. Enjoy hundreds of brand new pages covering exciting new language features, such as the DOM-based event architecture, E4X, and namespaces--all brimming with real-world sample code.
The ActionScript 3.0 revolution is here, and Essential ActionScript 3.0's steady hand is waiting to guide you through it.
Adobe Developer Library is a co-publishing partnership between O'Reilly Media and Adobe Systems, Inc. and is designed to produce the number one information resources for developers who use Adobe technologies. Created in 2006, the Adobe Developer Library is the official source for comprehensive learning solutions to help developers create expressive and interactive web applications that can reach virtually anyone on any platform. With top-notch books and innovative online resources covering the latest in rich Internet application development, the Adobe Developer Library offers expert training and in-depth resources, straight from the source.
Table of contents
- Special Upgrade Offer
- Foreword
- Preface
-
I. ActionScript from the Ground Up
-
1. Core Concepts
- 1.1. Tools for Writing ActionScript Code
- 1.2. Flash Client Runtime Environments
- 1.3. Compilation
- 1.4. Quick Review
- 1.5. Classes and Objects
- 1.6. Creating a Program
- 1.7. Packages
- 1.8. Defining a Class
- 1.9. Virtual Zoo Review
- 1.10. Constructor Methods
- 1.11. Creating Objects
- 1.12. Variables and Values
- 1.13. Constructor Parameters and Arguments
- 1.14. Expressions
- 1.15. Assigning One Variable’s Value to Another
- 1.16. An Instance Variable for Our Pet
- 1.17. Instance Methods
- 1.18. Members and Properties
- 1.19. Virtual Zoo Review
- 1.20. Break Time!
- 2. Conditionals and Loops
- 3. Instance Methods Revisited
- 4. Static Variables and Static Methods
- 5. Functions
-
6. Inheritance
- 6.1. A Primer on Inheritance
- 6.2. Overriding Instance Methods
- 6.3. Constructor Methods in Subclasses
- 6.4. Preventing Classes from Being Extended and Methods from Being Overridden
- 6.5. Subclassing Built-in Classes
- 6.6. The Theory of Inheritance
- 6.7. Abstract Not Supported
- 6.8. Using Inheritance in the Virtual Zoo Program
- 6.9. Virtual Zoo Program Code
- 6.10. It’s Runtime!
- 7. Compiling and Running a Program
-
8. Datatypes and Type Checking
- 8.1. Datatypes and Type Annotations
- 8.2. Untyped Variables, Parameters, Return Values, and Expressions
- 8.3. Strict Mode’s Three Special Cases
- 8.4. Warnings for Missing Type Annotations
- 8.5. Detecting Reference Errors at Compile Time
- 8.6. Casting
- 8.7. Conversion to Primitive Types
- 8.8. Default Variable Values
- 8.9. null and undefined
- 8.10. Datatypes in the Virtual Zoo
- 8.11. More Datatype Study Coming Up
- 9. Interfaces
- 10. Statements and Operators
-
11. Arrays
- 11.1. What Is an Array?
- 11.2. The Anatomy of an Array
- 11.3. Creating Arrays
- 11.4. Referencing Array Elements
- 11.5. Determining the Size of an Array
- 11.6. Adding Elements to an Array
- 11.7. Removing Elements from an Array
- 11.8. Checking the Contents of an Array with the toString( ) Method
- 11.9. Multidimensional Arrays
- 11.10. On to Events
-
12. Events and Event Handling
- 12.1. ActionScript Event Basics
- 12.2. Accessing the Target Object
- 12.3. Accessing the Object That Registered the Listener
- 12.4. Preventing Default Event Behavior
- 12.5. Event Listener Priority
- 12.6. Event Listeners and Memory Management
- 12.7. Custom Events
- 12.8. Type Weakness in ActionScript’s Event Architecture
- 12.9. Handling Events Across Security Boundaries
- 12.10. What’s Next?
- 13. Exceptions and Error Handling
- 14. Garbage Collection
-
15. Dynamic ActionScript
- 15.1. Dynamic Instance Variables
- 15.2. Dynamically Adding New Behavior to an Instance
- 15.3. Dynamic References to Variables and Methods
- 15.4. Using Dynamic Instance Variables to Create Lookup Tables
- 15.5. Using Functions to Create Objects
- 15.6. Using Prototype Objects to Augment Classes
- 15.7. The Prototype Chain
- 15.8. Onward!
- 16. Scope
-
17. Namespaces
- 17.1. Namespace Vocabulary
- 17.2. ActionScript Namespaces
- 17.3. Creating Namespaces
- 17.4. Using a Namespace to Qualify Variable and Method Definitions
- 17.5. Qualified Identifiers
- 17.6. A Functional Namespace Example
- 17.7. Namespace Accessibility
- 17.8. Qualified-Identifier Visibility
- 17.9. Comparing Qualified Identifiers
- 17.10. Assigning and Passing Namespace Values
- 17.11. Open Namespaces and the use namespace Directive
- 17.12. Namespaces for Access-Control Modifiers
- 17.13. Applied Namespace Examples
- 17.14. Final Core Topics
-
18. XML and E4X
- 18.1. Understanding XML Data as a Hierarchy
- 18.2. Representing XML Data in E4X
- 18.3. Creating XML Data with E4X
-
18.4. Accessing XML Data
- 18.4.1. Accessing the Root XML Node
- 18.4.2. Accessing Child Nodes
- 18.4.3. Accessing Text Nodes
- 18.4.4. Accessing Parent Nodes
- 18.4.5. Accessing Sibling Nodes
- 18.4.6. Accessing Attributes
- 18.4.7. Accessing Comments and Processing Instructions
- 18.4.8. Accessing Attributes and Elements Whose Names Contain Reserved Characters
- 18.4.9. Treating XMLList as XML, Revisited
- 18.5. Processing XML with for-each-in and for-in
- 18.6. Accessing Descendants
- 18.7. Filtering XML Data
- 18.8. Traversing XML Trees
-
18.9. Changing or Creating New XML Content
- 18.9.1. Changing the Contents of an Element
- 18.9.2. Changing an Attribute Value
- 18.9.3. Replacing an Entire Element
- 18.9.4. Adding New Attributes and Elements
- 18.9.5. Deleting Elements and Attributes
- 18.9.6. References to Parts of a Document Are Not Live
- 18.9.7. Using XML Entities for Special Characters
- 18.9.8. Assigning Values to an XMLList
- 18.10. Loading XML Data
- 18.11. Working with XML Namespaces
- 18.12. Converting XML and XMLList to a String
- 18.13. Determining Equality in E4X
- 18.14. More to Learn
-
19. Flash Player Security Restrictions
- 19.1. What’s Not in This Chapter
- 19.2. The Local Realm, the Remote Realm, and Remote Regions
- 19.3. Security-Sandbox-Types
- 19.4. Security Generalizations Considered Harmful
- 19.5. Restrictions on Loading Content, Accessing Content as Data, Cross-Scripting, and Loading Data
- 19.6. Socket Security
-
19.7. Example Security Scenarios
- 19.7.1. Snoopy Email Attachment—Without Flash Player Security
- 19.7.2. Snoopy Email Attachment—With Flash Player Security
- 19.7.3. Internal Corporate Information—Without Flash Player Security
- 19.7.4. Internal Corporate Information—With Flash Player Security
- 19.7.5. Cross-Web Site Information—Without Flash Player Security
- 19.7.6. Cross-Web Site Information—With Flash Player Security
- 19.8. Choosing a Local Security-Sandbox-Type
- 19.9. Distributor Permissions (Policy Files)
- 19.10. Creator Permissions (allowDomain( ))
- 19.11. Import Loading
- 19.12. Handling Security Violations
- 19.13. Security Domains
- 19.14. Two Common Security-Related Development Issues
- 19.15. On to Part II!
-
1. Core Concepts
-
II. Display and Interactivity
-
20. The Display API and the Display List
- 20.1. Display API Overview
-
20.2. The Display List
- 20.2.1. Containers and Depths
- 20.2.2. Removing Assets from Containers
- 20.2.3. Removing Assets from Memory
- 20.2.4. Removing All Children
- 20.2.5. Reparenting Assets
- 20.2.6. Traversing Objects in a Display Hierarchy
- 20.2.7. Manipulating Objects in Containers Collectively
- 20.2.8. Descendant Access to a .swf File’s Main Class Instance
- 20.3. Containment Events
- 20.4. Custom Graphical Classes
- 20.5. Go with the Event Flow
-
21. Events and Display Hierarchies
- 21.1. Hierarchical Event Dispatch
- 21.2. Event Dispatch Phases
-
21.3. Event Listeners and the Event Flow
- 21.3.1. Registering an Ancestor Listener for the Capture Phase
- 21.3.2. Registering an Ancestor Listener for the Bubbling Phase
- 21.3.3. Registering an Ancestor Listener for Both the Capture Phase and the Bubbling Phase
- 21.3.4. Registering a Listener with the Event Target
- 21.3.5. The Dual Purpose of the useCapture Parameter
- 21.3.6. Removing Event Listeners
- 21.4. Using the Event Flow to Centralize Code
- 21.5. Determining the Current Event Phase
- 21.6. Distinguishing Events Targeted at an Object from Events Targeted at That Object’s Descendants
- 21.7. Stopping an Event Dispatch
- 21.8. Event Priority and the Event Flow
- 21.9. Display-Hierarchy Mutation and the Event Flow
- 21.10. Custom Events and the Event Flow
- 21.11. On to Input Events
-
22. Interactivity
- 22.1. Mouse-Input Events
- 22.2. Focus Events
- 22.3. Keyboard-Input Events
- 22.4. Text-Input Events
- 22.5. Flash Player-Level Input Events
- 22.6. From the Program to the Screen
- 23. Screen Updates
- 24. Programmatic Animation
- 25. Drawing with Vectors
-
26. Bitmap Programming
- 26.1. The BitmapData and Bitmap Classes
- 26.2. Pixel Color Values
- 26.3. Creating a New Bitmap Image
- 26.4. Loading an External Bitmap Image
- 26.5. Examining a Bitmap
- 26.6. Modifying a Bitmap
- 26.7. Copying Graphics to a BitmapData Object
- 26.8. Applying Filters and Effects
- 26.9. Freeing Memory Used by Bitmaps
- 26.10. Words, Words, Words
-
27. Text Display and Input
- 27.1. Creating and Displaying Text
- 27.2. Modifying a Text Field’s Content
-
27.3. Formatting Text Fields
-
27.3.1. Formatting Text with the TextFormat Class
- 27.3.1.1. Available TextFormat variables
- 27.3.1.2. Embedded font warning: Bold and italic require separate fonts
- 27.3.1.3. setTextFormat( ) does not apply to future text assignments
- 27.3.1.4. Applying paragraph-level formatting
- 27.3.1.5. Retrieving formatting information for a span of characters
- 27.3.1.6. Default formatting for text fields
- 27.3.2. Formatting Text with HTML
- 27.3.3. Formatting Text with the StyleSheet Class
-
27.3.1. Formatting Text with the TextFormat Class
- 27.4. Fonts and Text Rendering
- 27.5. Missing Fonts and Glyphs
- 27.6. Determining Font Availability
- 27.7. Determining Glyph Availability
- 27.8. Embedded-Text Rendering
- 27.9. Text Field Input
- 27.10. Text Fields and the Flash Authoring Tool
- 27.11. Loading . . . Please Wait . . .
-
28. Loading External Display Assets
- 28.1. Using Loader to Load Display Assets at Runtime
- 28.2. Compile-Time Type-Checking for Runtime-Loaded Assets
- 28.3. Accessing Assets in Multiframe .swf Files
- 28.4. Instantiating a Runtime-Loaded Asset
- 28.5. Using Socket to Load Display Assets at Runtime
- 28.6. Removing Runtime Loaded .swf Assets
-
28.7. Embedding Display Assets at Compile Time
- 28.7.1. A Note on File Size and Memory Consumption
- 28.7.2. General [Embed] Syntax
- 28.7.3. Supported Asset Types
- 28.7.4. Embedding Bitmap Images
- 28.7.5. Embedding SVG
- 28.7.6. Embedding Entire .swf Files
- 28.7.7. Embedding Symbols from Legacy .swf Files
- 28.7.8. Embedding Files as Binary Data
- 28.7.9. Using getDefinition( ) to Access a Class in an Embedded .swf File
- 28.7.10. An [Embed] Example
- 28.7.11. Clean the Project to See Changes
- 28.8. On to Part III
-
20. The Display API and the Display List
-
III. Applied ActionScript Topics
-
29. ActionScript and the Flash Authoring Tool
- 29.1. The Flash Document
- 29.2. Timelines and Frames
- 29.3. Timeline Scripting
- 29.4. The Document Class
- 29.5. Symbols and Instances
- 29.6. Linked Classes for Movie Clip Symbols
- 29.7. Accessing Manually Created Symbol Instances
- 29.8. Accessing Manually Created Text
- 29.9. Programmatic Timeline Control
- 29.10. Instantiating Flash Authoring Symbols via ActionScript
- 29.11. Instance Names for Programmatically Created Display Objects
- 29.12. Linking Multiple Symbols to a Single Superclass
- 29.13. The Composition-Based Alternative to Linked Classes
- 29.14. Preloading Classes
- 29.15. Up Next: Using the Flex Framework
- 30. A Minimal MXML Application
- 31. Distributing a Class Library
-
29. ActionScript and the Flash Authoring Tool
- A. The Final Virtual Zoo
- Index
- About the Author
- Colophon
- Special Upgrade Offer
- Copyright
Product information
- Title: Essential ActionScript 3.0
- Author(s):
- Release date: June 2007
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9780596526948
You might also like
book
Essential ActionScript 2.0
In September 2003, Macromedia released Flash MX 2004, and with it, ActionScript 2.0, a dramatically improved …
book
Learning ActionScript 3.0, 2nd Edition
If you're new to ActionScript 3.0, or want to enhance your skill set, this bestselling book …
book
ActionScript 3.0 Cookbook
Well before Ajax and Microsoft's Windows Presentation Foundation hit the scene, Macromedia offered the first method …
book
The ActionScript 3.0 Quick Reference Guide
"No matter what your background, the pages that follow will provide you with some excellent knowledge, …