Visit SlideShowPro.net  Community Forums
SlideShowPro Help Wiki
  

SlideShowPro for Flash

Can't load XML data from a different domain

Use our cross domain maker utility to build your crossdomain.xml file!

By default, the Flash Player has a security wall that prevents the loading of data from a domain that is different from the one a SWF resides on. In other words, if your SWF were hosted on www.mydomain.com and either your static XML file or installation of Director were on www.myotherdomain.com, then the SWF wouldn’t have permission to load images.

So how to do you grant permission? It’s done with what’s called a “cross domain policy file.” It’s a simple XML file that the Flash Player automatically looks for at the outside domain (the one Director or your XML is hosted at), and if the file grants permission to the domain hosting your SWF, your images are allowed to load.

Create a cross domain policy file

Using any ASCII text editor (Notepad, Dreamweaver, TextWranger, etc) create a new file and name it crossdomain.xml (it must be named this). Then add the following:

<cross-domain-policy>
   <allow-access-from domain="" />
</cross-domain-policy>

This is the basic template. In the domain attribute, add the domain where your SWF resides. For example:

<cross-domain-policy>
   <allow-access-from domain="www.mydomain.com" />
   <allow-access-from domain="mydomain.com" />
</cross-domain-policy>

Notice that the domain is listed twice -- once with www and once without. This is in case the SWF is loaded from a URL that doesn’t include www. When complete, save.

Upload

Upload crossdomain.xml to the root of the domain where your XML file or SlideShowPro Director installation resides. For example, www.myotherdomain.com/crossdomain.xml

Reload your HTML/SWF in your web browser. Images should now be loading using data from the other domain.

Page last modified by afrmx on March 26, 2010, at 01:34 PM
© 2010 Dominey Design Inc. All Rights Reserved.
About | Merchandise | Contact | Privacy policy | Legal | Licensing