# Using SetInterval to reload an xml file

**URL:** <https://forum.kirupa.com/t/using-setinterval-to-reload-an-xml-file/256672>\
**Category:** Uncategorized\
**Created:** [April 5, 2008, 3:39pm UTC](https://forum.kirupa.com/t/using-setinterval-to-reload-an-xml-file/256672 "2008-04-05T15:39:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![samuk](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@samuk](https://forum.kirupa.com/u/samuk)\
**Post date:** [April 5, 2008, 3:39pm UTC](https://forum.kirupa.com/t/using-setinterval-to-reload-an-xml-file/256672/1 "2008-04-05T15:39:44Z")

</div>

Hi, i have an xml file that is regenerated every 10 mins.

I am trying to use the setinterval to reload my xml file in flash but cant get it to work??

Is what im trying do do possible? or is there a better way of doing it?

Thanks

```php
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("stocks.xml");
var origYposition:Number = 200;
_global.indicename = new Array();
_global.currentprice = new Array();
_global.valuechange = new Array();
_global.newLocation = new Array();
_global.cell = new Array();
var nInterval:Number = setInterval(loadXML, 60000);
function loadXML(loaded) {
 if (loaded) {
  for (i=0; i<32; i++) {
   _global.indicename.push(this.firstChild.childNodes*.childNodes[0].firstChild.nodeValue);
   _global.currentprice.push(this.firstChild.childNodes*.childNodes[1].firstChild.nodeValue);
   _global.valuechange.push(this.firstChild.childNodes*.childNodes[2].firstChild.nodeValue);
  }
  for (i=0; i<_global.indicename.length; i++) {
   _global.cell = "cell"+i;
   trace("Symbol = "+_global.indicename*+" Attached to - "+cell);
   trace("Current Price = "+_global.currentprice*);
   trace("Value Change = "+_global.valuechange*);
  }
 }
}

```
