Porting existing scripts to Flash Player 7
17
Domain-name rules for settings and local data
In Flash Player 6, superdomain matching rules are used by default when accessing local settings
(such as camera or microphone access permissions) or locally persistent data (shared objects).
That is, the settings and data for SWF files hosted at here.xyz.com, there.xyz.com, and xyz.com
are shared, and are all stored at xyz.com.
In Flash Player 7, exact-domain matching rules are used by default. That is, the settings and data
for a file hosted at here.xyz.com are stored at here.xyz.com, the settings and data for a file hosted
at there.xyz.com are stored at there.xyz.com, and so on.
A new property,
System.exactSettings
, lets you specify which rules to use. This property is
supported for files published for Flash Player 6 or later. For files published for Flash Player 6, the
default value is
false
, which means superdomain matching rules are used. For files published for
Flash Player 7, the default value is
true
, which means exact-domain matching rules are used.
If you use settings or persistent local data and want to publish a Flash Player 6 SWF file for Flash
Player 7, you might need to set this value to
false
in the ported file.
For more information, see
System.exactSettings
on page 662
.
Cross-domain and subdomain access between SWF files
When you develop a series of SWF files that communicate with each other—for example, when
using
loadMovie()
,
MovieClip.loadMovie()
,
MovieClipLoader.LoadClip()
, or Local
Connection objects—you might host the movies in different domains, or in different subdomains
of a single superdomain.
In files published for Flash Player 5 or earlier, there were no restrictions on cross-domain or
subdomain access.
In files published for Flash Player 6, you could use the
LocalConnection.allowDomain
handler
or
System.security.allowDomain()
method to specify permitted cross-domain access (for
example, to let a file at someSite.com be accessed by a file at someOtherSite.com), and no
command was needed to permit subdomain access (for example, a file at www.someSite.com
could be accessed by a file at store.someSite.com).
Files published for Flash Player 7 implement access between SWF files differently from earlier
versions in two ways. First, Flash Player 7 implements exact-domain matching rules instead of
superdomain matching rules. Therefore, the file being accessed (even if it is published for a Player
version earlier than Flash Player 7) must explicitly permit cross-domain or subdomain access; this
topic is discussed below. Second, a file hosted at a site using a secure protocol (HTTPS) must
explicitly permit access from a file hosted at a site using an insecure protocol (HTTP or FTP);
this topic is discussed in the next section (see
“HTTP to HTTPS protocol access between SWF
files” on page 19
).
Summary of Contents for FLASH MX 2004 - ACTIONSCRIPT
Page 1: ...ActionScript Reference Guide...
Page 8: ...8 Contents...
Page 12: ......
Page 24: ...24 Chapter 1 What s New in Flash MX 2004 ActionScript...
Page 54: ...54 Chapter 2 ActionScript Basics...
Page 80: ...80 Chapter 3 Writing and Debugging Scripts...
Page 82: ......
Page 110: ...110 Chapter 5 Creating Interaction with ActionScript...
Page 112: ......
Page 120: ...120 Chapter 6 Using the Built In Classes...
Page 176: ......
Page 192: ...192 Chapter 10 Working with External Data...
Page 202: ...202 Chapter 11 Working with External Media...
Page 204: ......
Page 782: ...782 Chapter 12 ActionScript Dictionary...
Page 793: ...Other keys 793 221 222 Key Key code...
Page 794: ...794 Appendix C Keyboard Keys and Key Code Values...
Page 798: ...798 Appendix D Writing Scripts for Earlier Versions of Flash Player...
Page 806: ...806 Appendix E Object Oriented Programming with ActionScript 1...
Page 816: ...816 Index...