# Sequencial Imagem loading to random loading

**URL:** <https://forum.kirupa.com/t/sequencial-imagem-loading-to-random-loading/158254>\
**Category:** flash\
**Created:** [August 8, 2005, 3:56pm UTC](https://forum.kirupa.com/t/sequencial-imagem-loading-to-random-loading/158254 "2005-08-08T15:56:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xcrap](https://avatars.discourse-cdn.com/v4/letter/x/ba8739/32.png) [@xcrap](https://forum.kirupa.com/u/xcrap)\
**Post date:** [August 8, 2005, 3:56pm UTC](https://forum.kirupa.com/t/sequencial-imagem-loading-to-random-loading/158254/1 "2005-08-08T15:56:40Z")

</div>

I’ve downloaded a free script that reads several JPG files and it makes a sequencial slideshow.

This is the function used:

ImageFader.prototype.loadXML = function (x) {  
var \_xml = new XML ();  
\_xml.ignoreWhite = true;  
\_xml.path = this;  
\_xml.load (x);  
\_xml.onLoad = function () {  
for (var a = 0; a \< this.firstChild.childNodes.length; a++) {  
var \_trans = this.firstChild.childNodes[a].attributes.TRANSITION;  
var \_pause = this.firstChild.attributes.PAUSE  
var \_img = this.firstChild.childNodes[a].firstChild.nodeValue;  
this.path.\_dataProvider.push ({img:\_img, transition:\_trans, pause:\_pause});  
}  
this.path.startFading ();  
delete this;  
};  
};

**My question is…**  
How to change that script to it loades random jpg from the xml in stead if loading img1, img2 from xml.

Anyone can help ? Thanks in advance
