Loading external data from Flash
As you may all know already, you will need to ensure that you have a crossdomain policy available on your domain to ensure that XML/external data can be read and loaded into your clients flash player.
Flash Player Security will not allow content to be read in from a different domain to where the current file is sitting on - and as you will most likely be aware, www.domain.com and domain.com are different, and not everyone uses the www. prefix.
If your flash application uses an absolute URL to load the content, say from reading an XML document or communicating with a data provider architecture (Flash Remoting, Web Services and the like) you will need to create a basic cross-domain.xml policy file that sits at the root of your domain (eg, www.domain.com/crossdomain.xml).
This is termed sandboxing and can be read on the Macromedia Developer Center: Security Changes in Macromedia Flash 7.
An example of a crossdomain.xml policy file from flash remoting random thoughts is as follows:
<br />
< ?xml version="1.0"?><br />
< !DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"><br />
<cross -domain-policy><br />
<allow -access-from domain="www.flash-remoting.com" /><br />
<allow -access-from domain="flash-remoting.com" /><br />
<allow -access-from domain="*.flash-remoting.com" /><br />
<allow -access-from domain="www.communitymx.com" /><br />
<allow -access-from domain="communitymx.com" /><br />
</cross><br />
Diagnosing if this is the issue
If you are trying to make a request (aka. such as reading in XML or communicating via Flash Remoting) to a remote domain (aka. lets say you are staging it on a test server connecting to a live server, like www.myserver.com looks at www.myclientshosting.com) the request will not leave flash and won’t receive a response from the target server. Most of the time a flash developer will see this as a continous load sequence that hangs during loading of the XML or Remoting request.
- Colin Moock provides a nice technote on this issue. for further reading.






The filename should be crossdomain.xml! sorry!
Comment by Cameron Manderson — August 30, 2006 @ 6:00 pm
[…] If we are to stage the site on a different domain and still want to access the Flash Remoting, we will need to set up a “crossdomain.xml” file that allows the staging domain to access the Flash Remoting Service - (See ‘Loading external data from Flash‘). This is achieved by creating a XML file named “crossdomain.xml” on the production domain and defining a set of properties specifying which other domains are allowed access its data (Remoting, XML etc). This all works nicely when we are working with a contained Flash Movie, allowing us to maintain the state on a remote domain. What happens when we wish to access that state information on a different domain? When switching from Flash to another language (say PHP) you will lose your session information. When we are to “break” out from the Flash into an HTML process (- lets say a HTML checkout process) accessing the ‘State’ of the session will not be available as the cookie is set for the Remoting Domain, not the one serving our local HTML. (See ‘sharing a session across multiple domains‘). […]
Pingback by melbourne chapter » Flash Remoting - Setting the alternate gateway URL through FlashVars — September 5, 2006 @ 1:25 pm