# XML preloader function

**URL:** <https://forum.kirupa.com/t/xml-preloader-function/169100>\
**Category:** flash\
**Created:** [November 13, 2005, 12:58pm UTC](https://forum.kirupa.com/t/xml-preloader-function/169100 "2005-11-13T12:58:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sliker\_Hawk](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@Sliker\_Hawk](https://forum.kirupa.com/u/Sliker_Hawk)\
**Post date:** [November 13, 2005, 12:58pm UTC](https://forum.kirupa.com/t/xml-preloader-function/169100/1 "2005-11-13T12:58:30Z")

</div>

I was playing round with some loading code that I (with alot of help from lostinbeta) made a while ago. I got it to load two XML files seperatly, but I had to use all the loading code twice. I really wanted to be able to put it inside a function, so that the code would be cleaner and easier to customize. Something like:

```auto
function loadXML(xmlfile, xmlname) {
// Code for loader here
 }

```

So I could call it like:

```auto
loadXML("html/scripts/news.xml, "newsXML")

```

Anyone know how to do that?

(The .fla only loads one XML file. It’s just to show you the code that’s supposed to do it)

EDIT: the fla should now work on Flash XM 2004.
