Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

Policy File - sharing XML files

This is a discussion on Policy File - sharing XML files within the Tutorials forums, part of the Flash English category; Greetings to all What is a Policy File ? A Policy File is a simple XML that contains a list of ?...


Go Back   Forum Flash CS3 Flash CS4 > Flash CS3 Flash CS4 > Flash English > Tutorials

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 14-12-07, 06:51
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,535
Rep Power: 6
Flep is on a distinguished road
Policy File - sharing XML files

Greetings to all


What is a Policy File ?
A Policy File is a simple XML that contains a list of ?trusted? domains.
It allows to access the data in format XML from the domain in which the SWF resides to other domains declared in the Policy File.
Let us make an example?
Let us suppose to have a SWF on domain1.com that loads the data from an XML file.
Let us suppose that we want to use the same XML file from another SWF which is on domain2.com.
Naturally, for security purpose, this sharing is not possible.
The solution is to create a Policy File that allows the so-called cross-domain and to add a file in the root of domain1.com which will pass the authorization to domain2.com to upload the data found on the XML file.

Let us see how to create a Policy File?


To create a Policy File is very simple and only requires 3 steps:
- to create a new XML file
- to add a list (or even a single one) of domains to which we want to allow the access using the official Adobe syntax
- to save the file as crossdomain.xml

This is an example of a Policy File:
HTML Code:
<?xml version="1.0" encoding="macintosh"?>
<!DOCTYPE cross-domain-policy 
SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="dominio2.com" />
</cross-domain-policy>
Obviously, instead of domain2.com you need to insert the name of the domain to which you want to allow the access to the XML files found on your domain.
Next, you add the crossdomain.xml file to the root of domain1.com.
This way, an SWF on domain2.com can access the XML files which are placed in domain1.com.

See you next !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
caricare files biggionny Actionscript 3.0 avanzato 0 02-10-08 16:34
Linking Buttons to SWF files? Rin Flash English 2 22-08-08 09:31
What files should upload stevekeen Actionscript 3.0 newbies 2 03-06-08 17:19
Policy File - condividere risorse XML Flep Articoli e tutorials 2 15-11-07 09:15
export for runtime sharing tia Actionscript 3.0 base 4 03-08-07 10:39


All times are GMT. The time now is 19:22.

Powered by vBulletin version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC4
Forum SiteMap