Hi, I am using Wikipedia API to get some info for me masters degree app, I run into a trouble when I test it localy everything works great but on the server I dont get the info from the API , any idea? I load the xml from URL like this http://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=Something&rvprop=content
Try fetching the XML content first by a PHP script on your server and then load it into Flash. You can’t load files from another doman unless a policy (crossdomain.xml) file exists on that domain and gives you permission.
Because php does not need policy to load external files, Flash does. So.. this way you use php as proxy to trick the policy thinghie. Flash reads the php because the php is on your server.
I am still not sure why I can load it from PHP but cant from Flash, its a magic If anyone have some solution please share it!
As wickedpixel said, PHP does not have the same security limitations as Flash. And when you use a PHP script to fetch the XML data you would probably use it on the same domain as the SWF file that’s why you can load data from it.
For a solution read what I’ve said above. There’s a link to an example on how to use PHP to fetch XML data from outside your domain.
Your best workaround is to get a simple PHP proxy script, for your “external” xml.
Flash doesn’t like reading files from other domains, unless a crossdomain.xml is present allowing you to do so, and that is because back in the day, developers used to suck alot of bandwidth from other sites.
If you need a simple proxy hit me up and ill shoot one to you.