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: