I am constructing a nice little photoalbum and ran into problems. I have a “next”-button and a “reset”-button. The next-button works fine, fading a new image into my window, but the reset wont. The reset-button is supposed to restore the alpha to 100, making the viewed pictures visible again.
If I click it nothing happends and it makes my application freeze (the next-button stops working). If the next-button is clicked repeatedly it begins to work again (???).
My code as follows:
var aImages:Array = new Array(mc01,mc02,mc03,mc04,mc05,mc06,mc07,mc08,mc09,mc10,mc11,mc12,mc13);
var nCurrentIndex:Number = 0;
var nInterval:Number;
var i:Number = aImages.length;
mcNext.onRelease = function():Void {
clearInterval(nInterval);
nInterval = setInterval(FadeImage, 25, aImages[nCurrentIndex]);
};
mcReset.onRelease = function() {
setProperty(aImages*,_alpha,100);
nCurrentIndex = 0;
updateAfterEvent();
};
function FadeImage():Void {
aImages[nCurrentIndex]._alpha -=5;
if (aImages[nCurrentIndex]._alpha <= 0) {
clearInterval(nInterval);
nCurrentIndex++;
};
updateAfterEvent();
};
Any help would be appreciated. The .fla is unfortunately too big for uploading