EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - About Constants and Keywords

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
About constants and keywords 135
Include one documentation comment per class, interface, or member, and place it directly
before the declaration. If you have additional information to document that does not fit into
the documentation comments, use implementation comments (in the format of block
comments or single-line comments). Implementation comments directly follow the
declaration.
The two kinds of comments use slightly different delimiters. Documentation comments are
delimited with
/** and */, and implementation comments are delimited with /* and */.
You can also use single-line comments, block comments, and trailing comments in class files.
For more information on these kinds of comments, see the following sections:
“Single-line comments” on page 132
“Multiline comments” on page 133
“Trailing comments” on page 134
About constants and keywords
Constants and keywords are the backbone of ActionScript syntax. Constants are properties
with a fixed value that cannot be altered, so they are values that dont change throughout
an application.
Flash includes several predefined constants, which can help simplify application development.
An example of constants can be found in the Key class, which includes many properties, such
as
Key.ENTER or Key.PGDN. If you rely on constants, you never have to remember that the key
code values for the Enter and Page Down keys are 13 and 34. Using constant values not only
makes development and debugging easier, but it also makes your code easier to read by your
fellow developers.
Keywords in ActionScript are used to perform specific kinds of actions. They are also reserved
words because of this, so you cant use them as identifiers (such as variable, function, or label
names). Examples of some reserved keywords are
if, else, this, function, and return.
For more information on constants and keywords, see the following topics:
“Using constants” on page 136
About keywords” on page 138
About reserved words” on page 139
TIP
Don’t include comments that do not directly relate to the class being read. For example,
do not include comments that describe the corresponding package.

Table of Contents

Related product manuals