702
Understanding Security
Server-side policy files for permitting
access to data
A Flash document can load data from an external source by using one of the following data
loading calls:
XML.load()
,
XML.sendAndLoad()
,
LoadVars.load()
,
LoadVars.sendAndLoad()
,
loadVariables()
,
loadVariablesNum(),
MovieClip.loadVariables()
,
XMLSocket.connect()
, and Macromedia Flash Remoting
(
NetServices.createGatewayConnection
). Also, a SWF file can import runtime shared
libraries (RSLs), or assets defined in another SWF file, at runtime. By default, the data or RSL
must reside in the same domain as the SWF file that is loading that external data or media.
To make data and assets in runtime shared libraries available to SWF files in different
domains, you should use a
cross-domain policy file
. A cross-domain policy file is an XML file
that provides a way for the server to indicate that its data and documents are available to SWF
files served from certain domains, or from all domains. Any SWF file that is served from a
domain specified by the server’s policy file is permitted to access data, assets, or RSLs from
that server.
If you are loading external data, you should create policy files even if you don’t plan to port
any files to Flash Player 7. If you are using RSLs, you should create policy files if either the
calling or called file is published for Flash Player 7.
For more information, see the following topics:
■
“Allowing cross-domain data loading” on page 702
■
“About custom policy file locations” on page 704
■
“About XMLSocket policy files” on page 705
Allowing cross-domain data loading
When a Flash document attempts to access data from another domain, Flash Player
automatically attempts to load a policy file from that domain. If the domain of the Flash
document that is attempting to access the data is included in the policy file, the data is
automatically accessible.
Policy files must be named crossdomain.xml, and can reside either at the root directory or in
another directory on the server that is serving the data with some additional ActionScript (see
“About custom policy file locations” on page 704
). Policy files function only on servers that
communicate over HTTP, HTTPS, or FTP. The policy file is specific to the port and protocol
of the server where it resides.
Содержание 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...