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.
-
Constant
width
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
_mc
for 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.-
Italic
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
duplicateMovieClip( )
.-
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.,
your
name
here
).Constant
width
italic
is 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 width
because they should both be entered verbatim. For example,Stage.width
orMath.NaN
.Instance-level properties are shown with the class or object instance in
constant
width italic
because it should be replaced by a specific instance. The property itself is shown inconstant width
and should be entered as shown. For example,Button
.tabEnabled
.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-calledstatic method
), as inTextField.getFontList( )
, or replace it with an instance name, such asball_mc.duplicateMovieClip( )
.For brevity, I often omit the class name when discussing a property or method of a class. For example, if discussing the
htmlText
property of theTextField
class, when I say “set thehtmlText
property,” you should infer from context that I mean, “set thesomeField_txt
.htmlText
property, wheresomeField_txt
is 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 width
to indicate that it is a property (albeit one storing a method name) oritalics
and 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:
Get Actionscript Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.