# URGENT ! gallerys images sildeshow using AS2

**URL:** <https://forum.kirupa.com/t/urgent-gallerys-images-sildeshow-using-as2/277784>\
**Category:** Uncategorized\
**Created:** [December 17, 2008, 8:52am UTC](https://forum.kirupa.com/t/urgent-gallerys-images-sildeshow-using-as2/277784 "2008-12-17T08:52:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gopi](https://avatars.discourse-cdn.com/v4/letter/g/7cd45c/32.png) [@gopi](https://forum.kirupa.com/u/gopi)\
**Post date:** [December 17, 2008, 8:52am UTC](https://forum.kirupa.com/t/urgent-gallerys-images-sildeshow-using-as2/277784/1 "2008-12-17T08:52:48Z")

</div>

Hi All,

I am new to AS2.

I am created a photogallery page using XML and AS2.  
an I am got effect. but have some problems. i.e. Its displays 1st image with alpha effect. andafter that it diplays 2nd image.

But , when diplaying 2nd image the 1st image is disappier suddenly. so I dont want that.  
I want to disappier the 1st image with alpha effect. and after that want to display the 2nd image with alpha effect.

=============  
This is My code

====

function loadXML(loaded)  
{  
if (loaded)  
{  
var \_loc2 = this.firstChild;  
image = [];  
caption = [];  
total = \_loc2.childNodes.length;  
for (i = 0; i \< total; i++)  
{  
image\* = \_loc2.childNodes\*.childNodes[0].firstChild.nodeValue;  
caption\* = \_loc2.childNodes\*.childNodes[1].firstChild.nodeValue;  
} // end of for  
p = total;  
slideshow();  
}  
else  
{  
content = “file not loaded!”;  
} // end else if  
false;  
} // End of the function  
function doLoading()  
{  
var \_loc2 = picture.getBytesTotal();  
var \_loc3 = picture.getBytesLoaded();  
preloader.\_visible = true;  
if (\_loc3 != \_loc2)  
{  
preloader.preload\_bar.\_xscale = 100 \* \_loc3 / \_loc2;  
}  
else  
{  
preloader.\_visible = false;  
if (picture.\_alpha \< 100)  
{  
picture.\_alpha = picture.\_alpha + 10;  
}  
else  
{  
delete this.onEnterFrame;  
} // end else if  
} // end else if  
} // End of the function  
function showPic()  
{  
caption\_txt.text = caption[p];  
picture.\_alpha = 0;  
picture.loadMovie(“images/” + image[p], 1);  
this.onEnterFrame = doLoading;  
} // End of the function

function nextImage()  
{  
p = p \< total - 1 ? (p + 1) : §;  
showPic§;  
if (playState)  
{  
clearInterval(myInterval);  
myInterval = setInterval(slideshow, 4000);  
} // end if  
} // End of the function  
function prevImage()  
{  
p = p \> 0 ? (p - 1) : §;  
showPic§;  
if (playState)  
{  
clearInterval(myInterval);  
myInterval = setInterval(slideshow, 4000);  
} // end if  
} // End of the function  
function slideshow()  
{  
clearInterval(myInterval);  
p = ++p \>= total ? (0) : §;  
showPic§;  
myInterval = setInterval(slideshow, 4000);  
} // End of the function  
function nextImage()  
{  
p = p \< total - 1 ? (p + 1) : (0);  
showPic§;  
if (playState)  
{  
clearInterval(myInterval);  
myInterval = setInterval(slideshow, 4000);  
} // end if  
} // End of the function  
function prevImage()  
{  
p = p \> 0 ? (p - 1) : (total - 1);  
showPic§;  
if (playState)  
{  
clearInterval(myInterval);  
myInterval = setInterval(slideshow, 4000);  
} // end if  
} // End of the function  
stop ();  
var myInterval = null;  
var playState = true;  
var image = new Array();  
var caption = new Array();  
var total = 0;  
var p = 0;  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“jalan\_merlimau\_imgs.xml”);  
listen = new Object();  
listen.onKeyDown = function ()  
{  
if (Key.getCode() == 37)  
{  
prevImage();  
}  
else if (Key.getCode() == 39)  
{  
nextImage();  
} // end else if  
};  
Key.addListener(listen);  
previous\_btn.onRelease = function ()  
{  
prevImage();  
};  
next\_btn.onRelease = function ()  
{  
nextImage();  
};  
btn\_mc.gotoAndStop(playState);  
btn\_mc.onRelease = function ()  
{  
clearInterval(myInterval);  
playState = !playState;  
this.gotoAndStop(playState);  
if (playState)  
{  
slideshow();  
} // end if  
};

=======================

Thanks,  
Gopi.:ponder::ponder::ponder:
