# XML Reader refresh problem

**URL:** <https://forum.kirupa.com/t/xml-reader-refresh-problem/230101>\
**Category:** flash\
**Created:** [June 22, 2007, 3:59pm UTC](https://forum.kirupa.com/t/xml-reader-refresh-problem/230101 "2007-06-22T15:59:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![davhamer](https://avatars.discourse-cdn.com/v4/letter/d/7ab992/32.png) [@davhamer](https://forum.kirupa.com/u/davhamer)\
**Post date:** [June 22, 2007, 3:59pm UTC](https://forum.kirupa.com/t/xml-reader-refresh-problem/230101/1 "2007-06-22T15:59:01Z")

</div>

I have an SWF on my website that reads an XML file and displeys the text on the site. I have it set to refresh every 2 seconds because the XML file is constantly updated. I have built the fla file using active script 2.0. When I test movie in flash it works. However, when I embed the swf on the website, it will not autorefresh. I don’t know what to do to get it to work on the website. If I close the browser, then reopen it, the correct info is displayed. It will not change if I leave the page open. I’m new to flash. Any info anyone has would be appreciated.

Here is the code

function loadXML(loaded) {  
if (loaded) {\_root.event = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;  
\_root.field1 = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;  
\_root.field2 = this.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;}  
else  
{trace(“file not loaded!”);; }  
if (\_root.event == “STUFF”) {field1\_txt.text = \_root.field1;  
field2\_txt.text = \_root.field2;} else {field1\_txt.text = “Nothing New”;  
title\_txt.text = " ";}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“[http://www.mydomain.com/rds/mylist.xml](http://www.mydomain.com/rds/mylist.xml)”);  
System.security.allowDomain(“[mydomain.com](http://mydomain.com)”, “[www.mydomain.com](http://www.mydomain.com)”);  
function updateData():Void  
{  
xmlData.load (“[http://www.mydomain.com/rds/mylist.xml](http://www.mydomain.com/rds/mylist.xml)”); // Reload xml data  
}  
var checkID:Number = setInterval(this, “updateData”, 2000); // Set the refresh duration to suit your needs.
