XML Reload when data changes

Hi

I have a swf banner slideshow which is continually looping through statistics and images for a business presentation. Once it is opened in the HTMl window it remains present for the whole day. I have an XML file loading the values in the dynamic text boxes. My problem is I’m not sure how I can force a reload if the XML changes. I.E. if a sales stat changes every 20mins and then the share price changes every 10 mins how would I ensure these updated statistics feed into the SWF without closing it down and launching it again or doing a refresh?

Any pointers would be greatly appreciated - i’ve search high and low for a solution.

Regards
Rachel

You could poll (repeatedly check) the xml file periodically and check its values against the existing loaded ones. If you have problems with the xml caching, append a random number to the url every time you load it e.g myxmlfile.xml?random=42321312. You could also use an xml socket (or other socket connection) if you have a socket server, and then you can respond immediately to any change without polling.

Hi EastCoast

Would you mind demonstrating the code of what you mean to help me understand? Here’s my loading data code:


var xmlfile:String;
var xmlf:String =  stage.loaderInfo.parameters.xmlfile;

if(xmlf!=null){
	xmlfile = xmlf;
}else{
	xmlfile = "http://server-path/feed_content.xml?feed=1";
}

var xmlLoader:URLLoader = new URLLoader();


xmlLoader.addEventListener(IOErrorEvent.IO_ERROR, function(evt:IOErrorEvent):void {},false,0,true);
xmlLoader.addEventListener(Event.COMPLETE, xmlLoadingDone);
xmlLoader.load(new URLRequest(xmlfile));