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