# Loading images all at once - xml Photo Gallery

**URL:** https://forum.kirupa.com/t/loading-images-all-at-once-xml-photo-gallery/86622
**Category:** flash
**Created:** [April 14, 2005, 12:28pm UTC](https://forum.kirupa.com/t/loading-images-all-at-once-xml-photo-gallery/86622 "2005-04-14T12:28:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![leira](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@leira](https://forum.kirupa.com/u/leira)
#### Post date: [April 14, 2005, 12:28pm UTC](https://forum.kirupa.com/t/loading-images-all-at-once-xml-photo-gallery/86622/1 "2005-04-14T12:28:45Z")

</div>

Hello, I am using this tutorial here:  
[http://www.kirupa.com/developer/mx2004/xml\_slideshow.htm](http://www.kirupa.com/developer/mx2004/xml_slideshow.htm)

But I want to preload **all** my images, and not have them load one by one as shown on the tutorial. Do I just tweak the preloader code (pasted below) or is this going to require a totally different code? By the way the images are going to be loaded from a URL inside an xml file, and not just a path from my images folder, not sure if that makes a difference.

Any help is appreciated, thanks!

## Here’s the preloader code from the tutorial

this.onEnterFrame = function() {  
filesize = picture.getBytesTotal();  
loaded = picture.getBytesLoaded();  
preloader.\_visible = true;  
if (loaded != filesize) {  
preloader.preload\_bar.\_xscale = 100\*loaded/filesize;  
} else {  
preloader.\_visible = false;  
if (picture.\_alpha\<100) {  
picture.\_alpha += 10;  
}  
}  
};
