"The best way to learn how to ride a bike is to hop on and give it a try." (Don’t forget your safety helmet!)

blogs.she7ata.com, mohammed shehata personal showcase and blogs website.

she7ata.com » blogs » articles » What is corssdomain.xml file and what it does for FlashPlayer?

What is corssdomain.xml file and what it does for FlashPlayer?

published at:9/15/2009, Flash & AS,
published by: she7ata

salam alikum and hello there ...

Did you tried to read or send/receive data from and to your Flash application and you receive the FlashPlayer security warning message ?, yes, it is all about security, Flash player doesn’t allow loading data from public servers unless a permission given.

To give the permission you need to use or create a simple xml file called crossdomain.xml and that's what flash will read to know what servers to connect to and what servers to allow.
 
If you do not want flash to display this warning message, you need to create this xml and add the trusted domains that allowed to access data, this file in general called a policy file, you will need to place this file on your remote server on your root directory so all flash application can access this policy file i.e
youserver/wwwroot/corssdomain.xml.
 
You will need to use corssdomain.xml file in those type of application that sends and receive data through an XMLsocket or even LoadVariables.
 
The routine is like the following.
When flash document request a data from another domain, flash player will look for the policy file and will read it, if the domain is included the flash player will continue loading or sending the data, if not, an error occur or nothing will return back in your player (normally undefined strings )
 
A policy file (corssdomain.xml) has two main nested tags  <cross-domain-policy> and <allow-access-from>
 
In the allow-access-form node you can either type a domain name, or an ip address or even a wildcard
 
Example, to allow domain name like she7ata.com
<cross-domain-policy>
            <allow-access-from>she7ata.com</allow-access-from>
</cross-domain-policy>
 
you can multiply tags or domains like  
<cross-domain-policy>
            <allow-access-from>she7ata.com</allow-access-from>
            <allow-access-from>www.she7ata.com</allow-access-from>
            <allow-access-from>www.aljazeera.net</allow-access-from>
</cross-domain-policy>
 
you can allow all domains by using the asterisk *
<cross-domain-policy>
            <allow-access-from>*</allow-access-from>
</cross-domain-policy>
 
Good luck ISA.

  categories

 » recent posts

 � recent replies

 » friends & links


COMMENT(S)

ADD COMMENT

name:*
email:*
website:
comment:
captcha:
she7ata.com, owned and managed by mohammed shehata
(C) 2000~2009
QUICK LINKS BLACKHAND, ELWARSHA, BLOGS, PORTFOLIOS
she7ata'sBlogs v1.0, beta, not just another wordpress or joomla site!