In order to indicate the various syntactic components of ActionScript, this book uses the following conventions:
Menu options are shown using the → character, such as File → Open.
Indicates code examples, code snippets, variable names, and parameter names.
Indicates function names, method names, class names, package names, URLs, filenames, datatypes, keywords, objects, and file suffixes such as .swf. In addition to being italicized in the body text, method and function names are also followed by parentheses, such as duplicateMovieClip( ).
Constant width bold
Indicates text that you must enter verbatim when following a
bold is also sometimes used within code examples for
emphasis, such as to highlight an important line of code in a
Constant width italic
Indicates code that you must replace with an appropriate
This is a tip. It contains useful information about the topic at hand, often highlighting important concepts or best practices.
This is a warning. It helps you solve and avoid annoying problems. Ignore at your own peril.
This is a note about ActionScript 2.0. It compares and contrasts ActionScript 2.0 with ActionScript 3.0, helping you to migrate to ActionScript 3.0 and to understand important differences between the two versions of the language.
Coding and vocabulary conventions used in this book include:
this is written
constant-width font because it
is an implicit parameter passed to methods and functions.
In general, the keyword
this is not included when making reference
to identifiers from within instance methods. However,
this is used to disambiguate instance
variables and instance methods from parameters and local
When discussing accessor methods and mutator methods, this book avoids the traditional terms accessor, mutator, getter, and setter. Instead, this book uses the unofficial terms retriever method and modifier method. See Chapter 3.
In a class definition that contains static variables, static methods, instance variables, instance methods, and a constructor method, this book lists the static variables first, followed by the static methods, the instance variables, the class constructor method, and finally, the instance methods.
This book uses ALL CAPITAL LETTERS for constant names.
When referring to static variables and static methods, this book always includes the name of the class that defines the variable or method.
Unless otherwise stated, function closures are referred to by the shorter term function. See Chapter 5 for a description of the difference between the two terms.
This book assumes that all code is compiled in strict mode. Furthermore, after Chapter 7, this book supplies type annotations for all variables, parameters, and return values.
Event listeners in this book are named using the format
eventName is the string name of the