# XML Photo Gallery - resize all images to movie window

**URL:** https://forum.kirupa.com/t/xml-photo-gallery-resize-all-images-to-movie-window/227982
**Category:** flash
**Created:** [June 4, 2007, 12:48pm UTC](https://forum.kirupa.com/t/xml-photo-gallery-resize-all-images-to-movie-window/227982 "2007-06-04T12:48:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![suedechaser](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@suedechaser](https://forum.kirupa.com/u/suedechaser)
#### Post date: [June 4, 2007, 12:48pm UTC](https://forum.kirupa.com/t/xml-photo-gallery-resize-all-images-to-movie-window/227982/1 "2007-06-04T12:48:39Z")

</div>

Hi all,

First time poster - wow what a great resource this site is!! (I hope I’m posting in the correct area)

Please don’t flame me, but, I downloaded the zip file called slideshow.zip - the one that automatically scrolls through images using an XML file and now I can’t find the original thread??

I have been looking through all the threads and posts here to find a way to resize all images when loaded into the movie window, and quite frankly, I’m lost.

Being very new to Flash, I hope I have my terminology correct when I ask if anyone knows of an additional function or code change to make any images in the image folder fit within the existing movie window. I have a lot of pics that are roughly the same size, so a little distortion doesn’t really matter that much.

Here is the code from the slideshow.zip file that I downloaded the other day:

function loadXML(loaded)  
{  
if (loaded)  
{  
xmlNode = this.firstChild;  
image = [];  
description = [];  
link = [];  
total = xmlNode.childNodes.length;  
for (i = 0; i \< total; i++)  
{  
image\* = xmlNode.childNodes\*.childNodes[0].firstChild.nodeValue;  
description\* = xmlNode.childNodes\*.childNodes[1].firstChild.nodeValue;  
link\* = xmlNode.childNodes\*.childNodes[2].firstChild.nodeValue;  
} // end of for  
firstImage();  
}  
else  
{  
content = “file not loaded!”;  
} // end else if  
} // End of the function  
function nextImage()  
{  
if (p \< total - 1)  
{  
++p;  
if (loaded == filesize)  
{  
picture.\_alpha = 0;  
picture.loadMovie(image[p], 1);  
desc\_txt.text = description[p];  
picture\_num();  
slideshow();  
} // end if  
} // end if  
} // End of the function  
function prevImage()  
{  
if (p \> 0)  
{  
–p;  
picture.\_alpha = 0;  
picture.loadMovie(image[p], 1);  
desc\_txt.text = description[p];  
picture\_num();  
} // end if  
} // End of the function  
function firstImage()  
{  
if (loaded == filesize)  
{  
picture.\_alpha = 0;  
picture.loadMovie(image[0], 1);  
desc\_txt.text = description[0];  
picture\_num();  
slideshow();  
link\_image();  
} // end if  
} // End of the function  
function picture\_num()  
{  
current\_pos = p + 1;  
pos\_txt.text = current\_pos + " / " + total;  
} // End of the function  
function slideshow()  
{  
function pause\_slideshow()  
{  
clearInterval(myInterval);  
if (p == total - 1)  
{  
p = 0;  
firstImage();  
}  
else  
{  
nextImage();  
} // end else if  
} // End of the function  
myInterval = setInterval(pause\_slideshow, delay);  
} // End of the function  
delay = 3000;  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“image\_and\_link.xml”);  
p = 0;  
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 = picture.\_alpha + 10;  
} // end if  
} // end else if  
picture.onRelease = function ()  
{  
getURL(link[p], “\_blank”);  
};  
};

Thank you do much in advance.

regards

suede
