# Why will this not WORK?

**URL:** <https://forum.kirupa.com/t/why-will-this-not-work/122756>\
**Category:** Uncategorized\
**Created:** [September 16, 2004, 5:37pm UTC](https://forum.kirupa.com/t/why-will-this-not-work/122756 "2004-09-16T17:37:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dimyas313](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@Dimyas313](https://forum.kirupa.com/u/Dimyas313)\
**Post date:** [September 16, 2004, 5:37pm UTC](https://forum.kirupa.com/t/why-will-this-not-work/122756/1 "2004-09-16T17:37:42Z")

</div>

I am learning actionscript and having a tough time of it…

Here is the script I am having problems with…the problems is that the alpha fade that I created, does not reset when a new images is loaded. Any ideas?  
Here is the script, any help would be much appreciated.

// start of script

onClipEvent (load) {  
photos = new Array(“images/mel\_1.jpg”, “images/mel\_2.jpg”, “images/mel\_3.jpg”, “images/mel\_4.jpg”, “images/mel\_5.jpg”);  
pictureNumber = photos.length;  
function getNextNumber() {  
pictureNumber++;  
if (pictureNumber\>=photos.length) {  
pictureNumber = 0;  
}  
trace(pictureNumber);  
return (pictureNumber);  
}  
function loadNextPhoto() {  
this.createEmptyMovieClip(“myPhotosHolder”, 1);  
myPhotosHolder.loadMovie(photos[getNextNumber()], 1);  
}  
function loadPhotos() {  
loadNextPhoto();  
setInterval(loadNextPhoto, 5000);  
}  
loadPhotos();  
}  
onClipEvent (enterFrame) {  
function fadeOut() {  
this.\_alpha -= 20;  
}  
if (getTimer()\>5000) {  
fadeOut();  
}  
}

// end of script

I have attached my .fla file with this thread.
