Naming conventions
733
Using naming conventions for your variable names can serve the following important
functions:
■
They make your code readable so that you can immediately identify a variable’s data type.
This can help students, those learning code, or developers unfamiliar with your code.
■
They are easy to search for and replace when necessary.
■
They help reduce conflicts with reserved words and language constructs.
■
They can help you distinguish between variables from different scopes (local variables,
class properties, parameters, and so on).
The following sections contain naming guidelines for writing ActionScript code, such as
naming files, variables, constants, components, and so on.
“Formatting ActionScript syntax”
on page 764
discusses formatting conventions that are specific to ActionScript, and common
in other programming languages.
“ActionScript coding conventions” on page 745
discusses
coding conventions that are specific to writing ActionScript and developing with Flash 8.
This section includes the following topics:
■
“General naming guidelines” on page 734
■
“Avoiding reserved words or language constructs” on page 734
■
“Naming variables” on page 736
■
“Naming constants” on page 738
■
“Naming Boolean variables” on page 738
■
“Naming functions and methods” on page 739
■
“Naming classes and objects” on page 739
■
“Naming packages” on page 741
■
“Naming interfaces” on page 741
■
“Naming custom components” on page 742
NO
TE
Flash Player 7 and 8 loosely follow the ECMAScript (ECMA-262) edition 3 language
specification. It is useful to see this specification for information on how the language
works. (See
www.ecma-international.org/publications/standards/Ecma-262.htm
.)
Содержание 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...