LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-10-2003, 07:51 PM
dv8's Avatar
dv8 dv8 is offline

Admin Mod
 
Join Date: Mar 2001
Posts: 2,053
Rep Power: 15
dv8 is on a distinguished road
Cross Domain Policy File

By default Flash Player 7 and later prevents a SWF served from one domain from accessing data, object, or variables from SWF files served from different domains. Nor can a SWF file served from one domain load data from another domain.

Excerpt from 2004 Help Panel: "About allowing cross-domain data loading"
Quote:
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. 

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 reside at the root directory of the server that is serving the data. 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.
Code:
<?xml version="1.0"?>
<!-- Example Cross Domain Policy File -->
<!-- http://www.dv8flasher.com/crossdomain.xml -->
<cross-domain-policy>
	<allow-access-from domain="*.mgbg.com" />
</cross-domain-policy>
In the policy file above, I allow the domain mgbg.com access to all data on my domain dv8flasher.com
(Note: localhost can access data from any domain)

With this policy we see the data after being loaded return undefined
[swf x=550 y=100 menu=false]http://www.tv5.com/elections/test.swf[/swf]
Why? The domain tv5.com is not listed in the policy file as an allowed domain.

And here we see data after being loaded returned as a string
[swf x=550 y=100 menu=false]http://media.mgbg.com/wkrg/flash/crossDomain/test.swf[/swf]
This works do to policy file having mgbg.com listed as an allowed domain.

Also, in the example policy file you will see the usage of the asterisk (*) or aka wildcard. If your a PC user you'll probably know the power of the wildcard (*). The wildcard makes it very easy for a user or developer to allow access to the data on his or her server for any domain serving the SWF to access their data.
So...
Code:
<?xml version="1.0"?>
<!-- Example Cross Domain Policy File -->
<!-- http://www.dv8flasher.com/crossdomain.xml -->
<cross-domain-policy>
	<allow-access-from domain="*" />
</cross-domain-policy>
Will allow any SWF served from a domain to access the data on dv8flasher.com

One element yet to be discovered is how to accurately acknowledge the type of error, if the SWF is unable to access the remote data.
To be continued...
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Configure Cross Domain Policy? freaksarise Flash CS3 / Flash 9 1 12-28-2009 11:44 AM
Cross Domain Issues (JS) jwaldrip Flash 8 0 11-01-2006 07:49 PM
A useful tips about how to extract .swf file from a PowerPoint file susanzheng General Flash 0 11-02-2005 07:56 AM
FlashMove recent tussle with domain issue FlashMove Members Cafe 6 03-28-2005 06:31 PM
Cross Domain Content Loading with loadPolicyFile whitenoiseie Actionscript 2.0 2 08-20-2004 06:32 PM




All times are GMT. The time now is 04:52 AM.