# XML, onLoad-function: retrieve the fliename?

**URL:** <https://forum.kirupa.com/t/xml-onload-function-retrieve-the-fliename/176000>\
**Category:** flash\
**Created:** [January 19, 2006, 3:26pm UTC](https://forum.kirupa.com/t/xml-onload-function-retrieve-the-fliename/176000 "2006-01-19T15:26:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CEOofAEP](https://avatars.discourse-cdn.com/v4/letter/c/7cd45c/32.png) [@CEOofAEP](https://forum.kirupa.com/u/CEOofAEP)\
**Post date:** [January 19, 2006, 3:26pm UTC](https://forum.kirupa.com/t/xml-onload-function-retrieve-the-fliename/176000/1 "2006-01-19T15:26:01Z")

</div>

I have a problem.

Okay, so that’s nothing new, really- but I also have a problem with processing XML :lol:

I have 4 XML files that are to be loaded- and I would prefer to use the same XML-handler for all of them… mostly because they all have the same structure and I have a function attached to the “onLoad” of the handler so it would be convenient.

Now here’s the problem- they all need to load in a row- and the result of the data retrieved from each of them needs to go into 4 different arrays. How can I tell the function which array to fill with the data… since all files “look” the same, really.

[AS]var xml\_channel:XML = new XML();  
xml\_channel.ignoreWhite = true;  
xml\_channel.onLoad = loadXMLchannel;

xml\_channel.load(“the\_filename.xml”);[/AS]  
Is there a way how the “loadXMLchannel”-function can tell (or be told) which file it’s currently processing? Would it be advisable to load all 4 files at once or make a function that handles the loading?

I really don’t know how to best go about this… I hope you can help 🙂
