# \[AS2\] Slideshow Problems

**URL:** <https://forum.kirupa.com/t/as2-slideshow-problems/125109>\
**Category:** Uncategorized\
**Created:** [October 10, 2004, 12:49pm UTC](https://forum.kirupa.com/t/as2-slideshow-problems/125109 "2004-10-10T12:49:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Majtorp](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@Majtorp](https://forum.kirupa.com/u/Majtorp)\
**Post date:** [October 10, 2004, 12:49pm UTC](https://forum.kirupa.com/t/as2-slideshow-problems/125109/1 "2004-10-10T12:49:17Z")

</div>

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 ☹
