RSS link icon

.

Flash cross domain access


If you work a lot with flash files, you will at some point find out that previous versions of flash (later then 7.0.19.0) Flash required a policy file to communicate between domains.

For instance, if you have a file file loading content from another domain, called cross domain access, you might get this error.

 

 

flash cross domain security

 

 

Basically saying that you are trying to access a file from another domain. This can easliy be fixed with one simple file, handling security.

 

Before we start making the file, there are some requirements. and here we go.

It has to be named excacly like this, crossdomain.xml and it must be placed in the root directory (eg. yourdomain.com/crossdomain.xml).

 

I read somewhere that if you use actionscript 3.0 you have to manually load it through Security.loadPolicyFile(). but acturlly this is not true all the time, sometimes I have made something and forgot this loadPolicyFile, but it all worked perfect.

 

Now make this crossdomain.xml file, use notepad or whatever editor you like best and type in the following code.

 

 

<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy>

<allow-access-from domain="*" />

</cross-domain-policy>

 

And as you can see, its using simple xml tags, so easy to read and understand, we use the >allow-access-from domain and set it equal to * (which is a wildcard meaning all).

 

or instead of doing no restrictions we could tell the server only to allow certain domains like this.

 

<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy>

<allow-access-from domain="www.mysite.com" to-ports="25" />

</cross-domain-policy>

 

Now only allowing access from www.mysite.com, which gives you a lot of control and avoiding security issues.

 

You can download a sample crossdomain xml file here

Download button


Admin Bob says: 2008-04-11

Hi zahir, im not sure I understand you question..

zahir says: 2008-04-09

how to contact details in asp codeing method