homepage Welcome to WebmasterWorld Guest from 54.226.166.224
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
Connecting to XML
wincode




msg:4246143
 7:03 am on Dec 26, 2010 (gmt 0)

Hi, is it possible to link to xml files from different websites? I have a code for a video player on my site and when the xml file is on my site, the player works. But when the xml file is on another website, the player doesn't play that file.

The line of code I'm using is:
<param name="FlashVars" value="configxml=videofiles/videofile.xml" />

The one above works because it's linking to a file on the site. But when I need to link to another site where I have xml files, I tried:
<param name="FlashVars" value="configxml=http://www.example.com/videofiles/videofile.xml" />
But that didn't work, any ideas how I can fix this?


Thanks for the help

[edited by: httpwebwitch at 8:00 am (utc) on Dec 26, 2010]
[edit reason] use example.com [/edit]

 

httpwebwitch




msg:4246148
 7:59 am on Dec 26, 2010 (gmt 0)

in one situation, the flash movie is reading from a file on the local file system. in the other, it has to make an HTTP request. I assume either the swf isn't wired up to make an HTTP request for the XML, or there may be a cross-domain permission issue.

your solution is to create a proxy on your server that fetches the XML remotely, and serves it locally.

It can be done with one line of code:

<?php
echo file_get_contents("http://example.com/file.xml");
?>

BTW this is the same thing you'd do if you needed to fetch remote data via AJAX.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved