About syntax, statements, and expressions
117
When you publish for versions of Flash Player (Flash Player 6 and earlier), Flash traces the
string
Jimmy
in the Output panel. Because Flash Player 7 and later versions are case-sensitive,
firstName
and
firstname
are two separate variables (when you use either ActionScript 1.0
or ActionScript 2.0). This is an important concept to understand. If you created FLA files for
Flash Player 6 or earlier with nonmatching capitalization in your variables, your functionality
and files might break during conversion of the file or application that targets a newer version
of the Flash Player.
Therefore, it’s good practice to follow consistent capitalization conventions, such as those
used in this manual. Doing so also makes it easier to differentiate between variables, classes,
and function names. Do not use case to make two identifiers differ. Change the instance,
variable, or class name—not just the case. For more information on coding conventions, see
Chapter 19, “Best Practices and Coding Conventions for ActionScript 2.0,” on page 731
.
Case sensitivity can have a large impact when you work with a web service that uses its own
rules for variable naming and for the case that variables are in when they are returned to the
SWF file from the server. For example, if you use a ColdFusion web service, property names
from a structure or object might be all uppercase, such as
FIRSTNAME
. Unless you use the same
case in Flash, you might experience unexpected results.
Case sensitivity is implemented for external scripts, such as ActionScript 2.0 class files, scripts
that you import using the
#include
command, and scripts in a FLA file. If you encounter
runtime errors and are exporting to more than one version of Flash Player, you should review
both external script files and scripts in FLA files to confirm that you used consistent
capitalization.
Case sensitivity is implemented on a per-SWF file basis. If a strict (case-sensitive) Flash Player
8 application calls a nonstrict Flash Player 6 SWF file, ActionScript executed in the Player 6
SWF file is nonstrict. For example, if you use
loadMovie()
to load a Flash Player 6 SWF file
into a Flash Player 8 SWF file, the version 6 SWF file remains case-insensitive, while the
version 8 SWF file is treated as case-sensitive.
When syntax coloring is enabled, language elements written with correct capitalization are
blue by default. For more information, see
“About reserved words” on page 139
.
NO
TE
Case sensitivity also affects external variables that you load into a SWF file, such as
those loaded with
LoadVars.load()
.
Содержание 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...