Synopses & Reviews
Given its ability to deliver high-impact multimedia, Flash has become the de facto standard for multimedia web developers worldwide. Flash 5 includes a new full-fledged programming language, "ActionScript," that controls animation and multimedia, and includes all common programming constructs (such as variables, loops, conditionals, and functions). ActionScript for Flash 5 is a quantum leap from previous versions, and "ActionScript: The Definitive Guide is the first book dedicated entirely to documenting and demonstrating the ActionScript programming language. "ActionScript: The Definitive Guide is structured so both programmers and non-programmers can learn how to use ActionScript. This book will take you well beyond simple Flash animations so you can create your own enhanced Flash-driven sites.
Synopsis
ActionScript: The Definitive Guide is for web developers and web authors who want to go beyond simple Flash animations to create enhanced Flash-driven sites. The book covers fundamental programming concepts; components, syntax, and usage; and how to use common applications. It includes a concise and detailed reference section that makes all ActionScript globals, properties, and objects easy to find and understand. This combination of ActionScript fundamentals, applications, and handy quick reference will have readers scripting like pros.
Synopsis
The definitive guide is for Web developers and Web authors who want to go beyond simple Flash animations to create enhanced Flash-driven sites, this book covers fundamental programming concepts as well as components, syntax, and usage, and how to use common applications.
Description
Given its ability to deliver high-impact experiences even over low-bandwidth connections, Flash has become the de facto standard for hundreds of thousands of multimedia web developers worldwide.
Flash 5 now includes a new full-fledged programming language called "ActionScript" for controlling animation and multimedia. It's a quantum leap from the bare-bones "Actions" supported in Flash 4, and ActionScript: The Definitive Guide is the first book dedicated entirely to documenting and demonstrating this new language.
ActionScript includes all fundamental programming constructs (variables, loops, conditionals, functions, etc.), and is inextricably fused with Flash's authoring behaviors and animation timelines. Because ActionScript is based heavily on the ECMAScript Language Specification (ECMA-262) and is syntactically nearly identical to JavaScript, Macromedia expects thousands of existing JavaScript programmers to migrate to ActionScript.
This book is divided into three sections.
"ActionScript Fundamentals" introduces both programmers and non-programmers to the new language by first describing fundamental programming concepts and then delineating in detail the components, syntax, and usage of ActionScript.
"Applied ActionScript Code Depot" shows you how to use common applications, such as processing online forms.
"Language Reference" is a concise and detailed reference that makes all ActionScript globals, properties, and objects, including extensive implementation samples, easy to find quickly.
Topics covered in this book include:
Step-by-step tutorials of the most common ActionScript behaviors
Object-oriented programming in Flash
Intelligent interface development
Server communication
Dynamic content generation
Password protection
String handling
Message boards
Basic physics
Games
ActionScript: The Definitive Guide is structured so both programmers and non-programmers can learn how to use ActionScript. This book will take you well beyond simple Flash animations so you can create your own enhanced Flash-driven sites.
About the Author
is an independent web guru with a passion for networked creativity and expression. He has been researching, designing, and developing for the Web since 1995. Colin served as webmaster for SoftQuad, Inc. (makers of HoTMetaL PRO) until 1997, and then as web evangelist for ICE (one of Canada's leading interactive agencies) until 2001. He has created interactive content for Sony, Levi's, Nortel, Air Canada, Procter & Gamble, and Hewlett-Packard. Colin now divides his time between writing, speaking at conferences, and researching emerging web technology. His award-winning Flash work and his renowned support site for Flash developers (http://www.moock.org) have made him a well-known personality in the Flash developer community. He is a contributor to macromedia.com's Flash developer center, a tutorialist in the Flash MX Bible (2002, Wiley Publishing Inc.), and regularly appears in industry magazines such as cre@te! online. Colin's latest personal undertaking is Unity (http://www.moock.org/unity/), a Flash socket server for multi-user content.
Table of Contents
Foreword; Preface; What Can ActionScript Do?; The Code Depot; Showcase; Typographical Conventions; We'd Like to Hear from You; Acknowledgments; ActionScript Fundamentals; Chapter 1: A Gentle Introduction for Non-Programmers; 1.1 Some Basic Phrases; 1.2 Further ActionScript Concepts; 1.3 Building a Multiple-Choice Quiz; 1.4 Onward!; Chapter 2: Variables; 2.1 Creating Variables (Declaration); 2.2 Assigning Variables; 2.3 Changing and Retrieving Variable Values; 2.4 Types of Values; 2.5 Variable Scope; 2.6 Some Applied Examples; 2.7 Onward!; Chapter 3: Data and Datatypes; 3.1 Data Versus Information; 3.2 Retaining Meaning with Datatypes; 3.3 Creating and Categorizing Data; 3.4 Datatype Conversion; 3.5 Primitive Data Versus Composite Data; 3.6 Onward!; Chapter 4: Primitive Datatypes; 4.1 The Number Type; 4.2 Integers and Floating-Point Numbers; 4.3 Numeric Literals; 4.4 Working with Numbers; 4.5 The String Type; 4.6 Working with Strings; 4.7 The Boolean Type; 4.8 Undefined; 4.9 Null; 4.10 Onward!; Chapter 5: Operators; 5.1 General Features of Operators; 5.2 The Assignment Operator; 5.3 Arithmetic Operators; 5.4 The Equality and Inequality Operators; 5.5 The Comparison Operators; 5.6 The String Operators; 5.7 The Logical Operators; 5.8 The Grouping Operator; 5.9 The Comma Operator; 5.10 The void Operator; 5.11 Other Operators; 5.12 Onward!; Chapter 6: Statements; 6.1 Types of Statements; 6.2 Statement Syntax; 6.3 The ActionScript Statements; 6.4 Statements Versus Actions; 6.5 Onward!; Chapter 7: Conditionals; 7.1 The if Statement; 7.2 The else Statement; 7.3 The else if Statement; 7.4 Simulating the switch Statement; 7.5 Compact Conditional Syntax; 7.6 Onward!; Chapter 8: Loop Statements; 8.1 The while Loop; 8.2 Loop Terminology; 8.3 The do-while Loop; 8.4 The for Loop; 8.5 The for-in Loop; 8.6 Stopping a Loop Prematurely; 8.7 Timeline and Clip Event Loops; 8.8 Onward!; Chapter 9: Functions; 9.1 Creating Functions; 9.2 Running Functions; 9.3 Passing Information to Functions; 9.4 Exiting and Returning Valuesfrom Functions; 9.5 Function Literals; 9.6 Function Availability and Life Span; 9.7 Function Scope; 9.8 Function Parameters Revisited; 9.9 Recursive Functions; 9.10 Internal Functions; 9.11 Functions as Objects; 9.12 Centralizing Code; 9.13 The Multiple-Choice Quiz Revisited; 9.14 Onward!; Chapter 10: Events and Event Handlers; 10.1 Synchronous Code Execution; 10.2 Event-Based AsynchronousCode Execution; 10.3 Types of Events; 10.4 Event Handlers; 10.5 Event Handler Syntax; 10.6 Creating Event Handlers; 10.7 Event Handler Scope; 10.8 Button Events; 10.9 Movie Clip Events Overview; 10.10 Movie-Playback Movie Clip Events; 10.11 The User-Input Movie Clip Events; 10.12 Order of Execution; 10.13 Copying Clip Event Handlers; 10.14 Refreshing the Screen with updateAfterEvent; 10.15 Code Reusability; 10.16 Dynamic Movie Clip Event Handlers; 10.17 Event Handlers Applied; 10.18 Onward!; Chapter 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 Named Array Elements; 11.7 Adding Elements to an Array; 11.8 Removing Elements from an Array; 11.9 General Array-Manipulation Tools; 11.10 Multidimensional Arrays; 11.11 The Multiple-Choice Quiz, Take 3; 11.12 Onward!; Chapter 12: Objects and Classes; 12.1 The Anatomy of an Object; 12.2 Instantiating Objects; 12.3 Object Properties; 12.4 Methods; 12.5 Classes and Object-Oriented Programming; 12.6 Built-in ActionScript Classes and Objects; 12.7 Onward!; Chapter 13: Movie Clips; 13.1 The "Objectness" of Movie Clips; 13.2 Types of Movie Clips; 13.3 Creating Movie Clips; 13.4 Movie and Instance Stacking Order; 13.5 Referring to Instances and Main Movies; 13.6 Removing Clip Instances and Main Movies; 13.7 Built-in Movie Clip Properties; 13.8 Movie Clip Methods; 13.9 Applied Movie Clip Examples; 13.10 The Last Quiz; 13.11 Onward!; Chapter 14: Lexical Structure; 14.1 Whitespace; 14.2 Statement Terminators (Semicolons); 14.3 Comments; 14.4 Reserved Words; 14.5 Identifiers; 14.6 Case Sensitivity; 14.7 Onward!; Chapter 15: Advanced Topics; 15.1 Copying, Comparing, and Passing Data; 15.2 Bitwise Programming; 15.3 Advanced Function Scope Issues; 15.4 The movieclip Datatype; 15.5 Onward!; Applied ActionScript; Chapter 16: ActionScript Authoring Environment; 16.1 The Actions Panel; 16.2 Adding Scripts to Frames; 16.3 Adding Scripts to Buttons; 16.4 Adding Scripts to Movie Clips; 16.5 Where's All the Code?; 16.6 Productivity; 16.7 Externalizing ActionScript Code; 16.8 Packaging Components as Smart Clips; 16.9 Onward!; Chapter 17: Flash Forms; 17.1 The Flash Form Data Cycle; 17.2 Creating a Flash Fill-in Form; 17.3 Onward!; Chapter 18: On-Screen Text Fields; 18.1 Dynamic Text Fields; 18.2 User-Input Text Fields; 18.3 Text Field Options; 18.4 Text Field Properties; 18.5 HTML Support; 18.6 Working with Text Field Selections; 18.7 Empty Text Fields and the for-in Statement; 18.8 Onward!; Chapter 19: Debugging; 19.1 Debugging Tools; 19.2 Debugging Methodology; 19.3 Onward!; Language Reference; Chapter 20: ActionScript Language Reference; 20.1 Global Functions; 20.2 Global Properties; 20.3 Built-in Classes and Objects; 20.4 Entry Headings; 20.5 Alphabetical Language Reference; Appendixes; Resources; ActionScript and Programming; ECMA-262 Resources; Object-Oriented Programming; SWF File Format; Latin 1 Character Repertoire and Keycodes; Backward Compatibility; Updates to the Flash 5 Player, Build 41; Controlling Movie Clips; Differences from ECMA-262 and JavaScript; Colophon;