# Problem with loading multiple external xml fies

**URL:** <https://forum.kirupa.com/t/problem-with-loading-multiple-external-xml-fies/242391>\
**Category:** flash\
**Created:** [October 25, 2007, 1:36pm UTC](https://forum.kirupa.com/t/problem-with-loading-multiple-external-xml-fies/242391 "2007-10-25T13:36:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![psych](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/psych/32/2839_2.png) [@psych](https://forum.kirupa.com/u/psych)\
**Post date:** [October 25, 2007, 1:36pm UTC](https://forum.kirupa.com/t/problem-with-loading-multiple-external-xml-fies/242391/1 "2007-10-25T13:36:03Z")

</div>

I have an array named ‘source’ which consists of external xml file names whose content i am trying to load into another array called ‘content’. I tried with following:

```auto
.....
for (i=0; i<source.length; i++){
   XML_URL = "http://localhost/temp/" + source*;
   myXMLURL = new URLRequest (XML_URL);    
   myLoader = new URLLoader (myXMLURL);
   myLoader.addEventListener(Event.COMPLETE, xmlLoaded);    
}    
....
function xmlLoaded(evt:Event):void{
    content.push(myLoader.data);
}

```

The problem is that this way i only get content of the last xml file and other ‘content’ elements are ‘undefined’. Does anyone know solution to this problem or maybe have another way of doing this?

thanks in advance
