![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
In a case-sensitive programming language, variable names that differ only in case (book
and Book
) are considered different from each other. Therefore, it's good practice to follow consistent capitalization conventions, such as those used in this manual, to make it easy to identify names of functions and variables in ActionScript code.
When you publish files for Flash Player 7 or later, Flash implements case sensitivity whether you are using ActionScript 1 or ActionScript 2.0. This means that keywords, class names, variables, method names, and so on are all case sensitive. For example:
// In file targeting Flash Player 7 // and either ActionScript 1 or ActionScript 2.0 // // Sets properties of two different objects cat.hilite = true; CAT.hilite = true; // Creates three different variables var myVar=10; var myvar=10; var mYvAr=10; // Does not generate an error var array = new Array(); var date = new Date();
This change also affects external variables loaded with LoadVars.load()
.
In addition, case sensitivity is implemented for external scripts, such as ActionScript 2.0 class files or scripts that you import using the #include
command. If you are publishing files for Flash Player 7 and have previously created external files that you add to your scripts by using the #include
statement, you should review each file and confirm that you used consistent capitalization throughout. One way to do this is to open the file in the Script window (Flash Professional only) or, in a new FLA file, set your publish settings to Flash Player 7 and copy the file's contents into the Actions panel. Then use the Check Syntax button (see Checking syntax and punctuation) or publish your file; errors that are caused by naming conflicts appear in the Output panel.
When Syntax coloring is enabled, language elements written with correct capitalization are blue by default. For more information, see Keywords and Syntax highlighting.
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |