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()
. Also, a SWF file can import runtime shared libraries, or assets defined in another SWF file, at runtime. By default, the data or SWF media, in the case of runtime shared libraries, 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, 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 will be permitted to access data or assets from that server.
You can also permit access to documents originating from any domain, as shown in the following example:
<?xml version="1.0"?><!-- http://www.foo.com/crossdomain.xml --><cross-domain-policy> <allow-access-from domain="*" /></cross-domain-policy>
No comments:
Post a Comment