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 don’t 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 can’t 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.
Содержание FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Страница 1: ...Learning ActionScript 2 0 in Flash...
Страница 8: ...8 Contents...
Страница 18: ...18 Introduction...
Страница 30: ...30 What s New in Flash 8 ActionScript...
Страница 66: ...66 Writing and Editing ActionScript 2 0...
Страница 328: ...328 Interfaces...
Страница 350: ...350 Handling Events...
Страница 590: ...590 Creating Interaction with ActionScript...
Страница 710: ...710 Understanding Security...
Страница 730: ...730 Debugging Applications...
Страница 780: ...780 Deprecated Flash 4 operators...
Страница 830: ...830 Index...