# Preload xml

**URL:** <https://forum.kirupa.com/t/preload-xml/172697>\
**Category:** Uncategorized\
**Created:** [December 16, 2005, 10:41pm UTC](https://forum.kirupa.com/t/preload-xml/172697 "2005-12-16T22:41:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nitras](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nitras/32/1475_2.png) [@nitras](https://forum.kirupa.com/u/nitras)\
**Post date:** [December 16, 2005, 10:41pm UTC](https://forum.kirupa.com/t/preload-xml/172697/1 "2005-12-16T22:41:58Z")

</div>

hi, i did some test with preloads from the flash help file  
works well

now, i have to update an old site it uses tons of xml files combined in one xml  
so i really don’t want to change that xml

i am stuck here, cuz i can’t seem to manage to attach a preloader for everytime a new picture needs to be loaded

is there anyone who can guide me a bit?  
appreciated!

the actionscript i really like to keep.

```auto

slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load("slidestotal.xml");
slides_xml.ignoreWhite = true;

function startSlideShow(succes) {
    if (succes ==true) {
            rootNode = slides_xml.firstChild;
            totalSlides = rootNode.childNodes.length;
            firstSlideNode = rootNode.firstChild;
            currentSlideNode = firstSlideNode;
            currentIndex = 1;
            updateSlide(firstSlideNode);
            }
}
function updateSlide(newSlideNode) {
    imagePath = newSlideNode.attributes.jpegURL;
    slideText = newSlideNode.firstChild.nodeValue;
    loadMovie(imagePath, "fotohouder");
    }
next_btn.onRelease = function() {
    nextSlideNode = currentSlideNode.nextSibling;
    if (nextSlideNode == null) {
        break;
    }else {
        currentIndex++;
        updateSlide(nextSlideNode);
        currentSlideNode = nextSlideNode;
            }    
};
back_btn.onRelease = function() {
        previousSlideNode = currentSlideNode.previousSibling;
        if (previousSlideNode == null) {
        break;
        } else {
        currentIndex--;
        currentSlideNode = previousSlideNode;
        updateSlide(previousSlideNode);
    }
    };
onEnterFrame = function (){
    if (currentIndex-1 <= 0) {
        next_btn._visible = true;
        back_btn._visible = false;
    } else if (currentIndex >= rootNode.childNodes.length){
        next_btn._visible = false;
        back_btn._visible = true;
    } else {
        next_btn._visible = false;
        back_btn._visible = false;
        }
}

```

i am using a simple bar to simulate the download percent called “bar”.  
i bet it needs to preload the xml, so in order to show the slides, i’ll have to disable the startSlideshow function  
and trigger it when the bytes are loaded right?
