Flash CS3 Documentation |
|||
| Learning ActionScript 2.0 in Adobe Flash > Syntax and Language Fundamentals > 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:
For more information on objects and properties, see Object data type. For a list of constants in the language (such as false and NaN), see the ActionScript Language Elements > Constants category in the ActionScript 2.0 Language Reference.
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00000695.html