Hi. I have made a flash gallery that loads images from an xml file and fades them in and out. However I have been asked to make it so they fade in from left to right (i.e. hiding a bit of image while slowly revealing the whole image). Code is below:
_root.onEnterFrame=function () {
var picLoaded = thisLoader.getBytesLoaded(), picBytes = thisLoader.getBytesTotal();
if (isNaN(picBytes) || picBytes < 4)
return;
updateLoader( (picLoaded/picBytes)*100 );
if ( picLoaded / picBytes >= 1 ) {
endLoader();
setButtonOn( eval("_level0.NavContainer.btnContainer.btn_"+(currentPicture)+".lbl_"+(currentPicture)) );
centerMovie( thisLoader );
swapPlace();
alphaTween = new mx.transitions.Tween(thisLoader, "_alpha", mx.transitions.easing.Regular.easeIn,0,100,2,true);
timerInterval = setInterval( imageGen, hold*1000 );
updateDescription();
lastPicture = ( currentPicture > 1 ? currentPicture - 1 : 1 );
currentPicture = ( currentPicture == maxPicture ? 1 : currentPicture + 1 );
if( maxPicture>1 ){
eval("_container.movie"+( showing == 2 ? 1 : 2 ))._alpha = 0;
}
btn_previous.enabled = true;
btn_next.enabled = true;
delete this.onEnterFrame;
}
}