Learning ActionScript 2.0 in Adobe Flash |
|
|
|
| Best Practices and Coding Conventions for ActionScript 2.0 > Naming conventions > General naming guidelines | |||
This section reviews naming guidelines for writing ActionScript code. Naming conventions are important for writing logical code. The primary purpose is to improve the readability of your ActionScript 2.0 code. Remember that all variables must have unique names. Names are case-sensitive in Flash Player 7 and later. Do not use the same name with a different case, because this can be confusing to programmers reading your code and can cause problems in earlier versions of Flash that do not force case sensitivity. Keep the following guidelines in mind when you name items such as variables, files, and classes in Flash:
Use abbreviations consistently. An abbreviation must clearly stand for only one thing. For example, the abbreviation "sec" might represent "section" and "second."
Use mixed-cases (upper and lower case) when you concatenate words to distinguish between each word for readability. For example, select myPelican rather than mypelican.
addUser.For example, if you retrieve a piece of data that is the visitor's user name, you might use the getUserName() method instead of the less descriptive getData() method. This example expresses what is happening rather than how you accomplish it.
Remember to keep names descriptive.
The following sections offer more detail on naming items such as variables, classes, packages, and constants in your code.
|
|
|
|