# Why will this not WORK?

**URL:** <https://forum.kirupa.com/t/why-will-this-not-work/64483>\
**Category:** flash\
**Created:** [September 16, 2004, 5:37pm UTC](https://forum.kirupa.com/t/why-will-this-not-work/64483 "2004-09-16T17:37:42Z")\
**Posts on this page:** 2\
**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/64483/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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 17, 2004, 6:27am UTC](https://forum.kirupa.com/t/why-will-this-not-work/64483/2 "2004-09-17T06:27:00Z")

</div>

I think that \_alpha : “this.\_alpha -= 20;” is wrong syntax…

The number of \_alpha property is at %, so you can’t put -20………

The correct syntax is this.\_alpha = 20, so the photo will have a translucency of 20%.

I hope now it’s OK…
