To indicate the various syntactic components of ActionScript, this book uses the following conventions:
- Menu options
Menu options are shown using the → character, such as File → Open.
Indicates code samples, clip instance names, frame labels, property names, and variable names. Variable names often end with the standard suffixes that activate code-hinting (such as
_mcfor variables that refer to movie clip instances). Although using these suffixes is considered the best practice, for brevity or clarity, the preferred suffixes have sometimes been omitted.
Indicates function names, method names, class names, layer names, symbol linkage identifiers, URLs, filenames, and file suffixes such as .swf. In addition to being italicized, method and function names are also followed by parentheses, such as
Constant width bold
Indicates text that you must enter verbatim when following a step-by-step procedure, although it is sometimes used within code examples for emphasis, such as to highlight an important line of code in a larger example.
Constant width italic
Indicates code that you must replace with an appropriate value (e.g.,
italicis also used to emphasize variable, property, method, and function names referenced in comments within code examples.
When referring to properties and methods of objects and classes, I use these conventions:
Class-level (static) properties are shown with the both the class name and property in
constant widthbecause they should both be entered verbatim. For example,
Instance-level properties are shown with the class or object instance in
width italicbecause it should be replaced by a specific instance. The property itself is shown in
constant widthand should be entered as shown. For example,
Method and function names, and the class or object to which they pertain, are always shown in italics and followed by parentheses, as in
MovieClip.duplicateMovieClip( ). Refer to the online help or ActionScript for Flash MX: The Definitive Guide to know whether to include the class name literally (i.e., if it is a so-called
static method), as in
TextField.getFontList( ), or replace it with an instance name, such as
For brevity, I often omit the class name when discussing a property or method of a class. For example, if discussing the
htmlTextproperty of the
TextFieldclass, when I say “set the
htmlTextproperty,” you should infer from context that I mean, “set the
someField_txtis the identifier for your particular text field.”
In some cases, an object property will contain a reference to a method or callback handler. It wasn’t always clear whether I should have used
constant widthto indicate that it is a property (albeit one storing a method name) or
italicsand parentheses to indicate it is a method (albeit one stored in a property). If the line between a property referring to a method versus the method itself is sometimes blurred, forgive me. To constantly harp on the technical difference would have made the text considerably less accessible and readable.
Pay special attention to notes and warnings set apart from the text with the following icons:
This is a tip. It contains useful information about the topic at hand, often highlighting important concepts or best practices.