User Guide

14 Chapter 1: What’s New in Flash MX 2004 ActionScript
Also, Flash Player 7 implements several changes that affect how one SWF file can access another
SWF file, how external data can be loaded, and how local settings and data (such as privacy
settings and locally persistent shared objects) can be accessed. Finally, the behavior of some
existing features has changed.
If you have existing scripts written for Flash Player 6 or earlier that you want to publish for Flash
Player 7, you might need to modify the scripts so they conform with the implementation of Flash
Player 7 and work as designed. These modifications are discussed in this section under the
following headings:
“ECMA-262 compliance” on page 14
“Domain-name rules for settings and local data” on page 15
“Cross-domain and subdomain access between SWF files” on page 15
“HTTP to HTTPS protocol access between SWF files” on page 18
“Server-side policy files for permitting access to data” on page 19
ECMA-262 compliance
Several changes were implemented in Flash Player 7 to conform more closely to the ECMA-262
Edition 3 standard (see www.ecma-international.org/publications/standards/Ecma-262.htm). In
addition to the class-based programming techniques available in ActionScript 2.0 (see “New
object-oriented programming model” on page 21), other features have been added and certain
behaviors have changed. Also, when publishing for Flash Player 7 and using ActionScript 2.0, you
can cast one object type to another. For more information, see “Casting objects” on page 42.
These capabilities dont require you to update existing scripts; however, you might want to use
them if you publish your scripts to Flash Player 7 and then continue to revise and enhance them.
Unlike the changes mentioned above, the changes listed in the following table (some of which
also improve ECMA compliance) can cause existing scripts to work differently than they did
before. If you used these features in existing scripts that you want to publish to Flash Player 7,
review the changes to make sure your code still works as intended or to determine whether you
need to rewrite your code. In particular, because
undefined is evaluated differently in certain
cases, you should initialize all variables in scripts that you port to Flash Player 7.
SWF file published for Flash Player 7 SWF file published for earlier versions of
Flash Player
Case-sensitivity is enforced (variable names that
differ only in capitalization are interpreted as being
different variables). This change also affects files
loaded with
#include and external variables loaded
with
LoadVars.load(). For more information, see
“Case sensitivity” on page 28.
Case-sensitivity is not supported (variable
names that differ only in capitalization are
interpreted as being the same variable).
Evaluating
undefined in a numeric context returns
NaN.
myCount +=1;
trace(myCount); // NaN
Evaluating undefined in a numeric context
returns 0.
myCount +=1;
trace(myCount); // 1