# Load multiple XML files

**URL:** <https://forum.kirupa.com/t/load-multiple-xml-files/306024>\
**Category:** flash\
**Created:** [March 8, 2010, 3:11pm UTC](https://forum.kirupa.com/t/load-multiple-xml-files/306024 "2010-03-08T15:11:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![randyohhh](https://avatars.discourse-cdn.com/v4/letter/r/50afbb/32.png) [@randyohhh](https://forum.kirupa.com/u/randyohhh)\
**Post date:** [March 8, 2010, 3:11pm UTC](https://forum.kirupa.com/t/load-multiple-xml-files/306024/1 "2010-03-08T15:11:33Z")

</div>

Hello,

I’m new to the group and to Flash coding. I’m working on a proof of concept for work and I am completely stumped. With my limited knowledge and a lot of questions I have been able to get my template working but now the tricky part, it loads from 1 XML file just fine, but I need to cycle through 3-4 files that are identical in format, just different feeds.

I have literally spent 3 days trying to figure this out and I just keep breaking it. If someone could have a look at my code and suggest how to do it I would greatly appreciate it.

```auto

var xmlholder:URLLoader = new URLLoader();
xmlholder.addEventListener(Event.COMPLETE, onload);

var timer:Timer = new Timer(10 * 2000); // update every 20 seconds
timer.start();
//timer.addEventListener(TimerEvent.TIMER, timerUpdate);

var currentTimeUpdated:String;

loadXML();

function timerUpdate(e:TimerEvent):void 
{
    loadXML();
}

function loadXML():void 
{
    xmlholder.load(new URLRequest("feed1.xml"));//?t=" + timestamp()));

    
}

function onload(e:Event):void 
{
    var myXML:XML = new XML(xmlholder.data);

    //if(myXML.@timeUpdated != currentTimeUpdated)
    for (var i:int =0; i<myXML.details.length();i++)
    {
        title.text=myXML.event_info[0].event_short_name;
        buyin.text=myXML.event_info[0].buyin;
        entries.text=myXML.event_info[0].entries;
        first_place.text=myXML.event_info[0].first_place;
        remaining.text=myXML.event_info[0].remaining;
        var row:MedalRow = new MedalRow();
        var ldr=new Loader();
        row.y=80+i*row.height+10;
        currentTimeUpdated =myXML.@timeUpdated;
        row.last_name.text=myXML.details*.last_name;
        row.first_name.text=myXML.details*.first_name;
        row.chips.text=myXML.details*.chips;
        this.addChild(row);
        var ldr = new Loader();
        ldr.load(new URLRequest("flags16/"+String(myXML.details*.country_id).toLocaleLowerCase()+".png"));
        row.flagHolder.addChild(ldr);
    }
}

function timestamp():String 
{
return stage.loaderInfo.url.indexOf("http") == 0 ? "?t=" + new Date().time : "";
} 

```

Many thanks,

Randy  
Montreal, Canada
