Using cross-domain.xml with Flex application

Hi All,

Sometime we face issues while accessing .SWF/Flash files from remote domains. Sometime you will see few blogs asking us to change the browser settings.  But there is a workaround provided in Flex, There is ae Security class object which lets you specify how content in different domains can communicate with each other.

There are two main methods which we can use for this purpose.

1. Security.allowDomain(“*”)
2. Security.allowInsecureDomain(“<DOMAIN_NAME>”);

NOTE: Use allowInsecureDomain() only to enable scripting from non-HTTPS files to HTTPS files.


Second alternative is to use Cross-domain.xml

Crossdomain basically allows you to connect between servers (i.e. load in external files from external URLs/domains) pretty handy when you need information sitting on external servers.

<allow-access-from domain=”*” to-ports=”507″ />
<allow-access-from domain=”*” to-ports=”507,516″ />
<allow-access-from domain=”*” to-ports=”516-523″ />
<allow-access-from domain=”” to-ports=”507,516-523″ />
<allow-access-from domain=”” to-ports=”*” />

If you are hosting you application on Tomcat, put the crossdomain.xml in root application folder.
<<Tomcat 6.0>>\webapps\ROOT\cross-domain.xml

R Vashi.

1 thought on “Using cross-domain.xml with Flex application

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.