# Change Thumbnail On Click/Press

**URL:** https://forum.kirupa.com/t/change-thumbnail-on-click-press/105746
**Category:** Uncategorized
**Created:** [March 29, 2004, 3:24pm UTC](https://forum.kirupa.com/t/change-thumbnail-on-click-press/105746 "2004-03-29T15:24:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![alwaysdrifting](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@alwaysdrifting](https://forum.kirupa.com/u/alwaysdrifting)
#### Post date: [March 29, 2004, 3:24pm UTC](https://forum.kirupa.com/t/change-thumbnail-on-click-press/105746/1 "2004-03-29T15:24:32Z")

</div>

Hey all,

I want to change the alpha of a thumbnail after it has been pressed, to indicate that the user has clicked it.

However, I also am changing the alpha when the user hovers over it and On Mouse Out. I’ve tired this:  
[AS]on (press){  
this.\_alpha -= 50;  
}  
[/AS]

What seems to happen here is that if the user clicks on it again, it can’t be seen.

A problem with the below code it, On Mouse over, it fades it by 50. Then, On Click, it disappears. Then, on mouse out, it fades back to 100.

[AS]on (press){  
this.\_alpha -= 50;  
}

onClipEvent (load) {  
this.\_alpha = 100;  
}  
onClipEvent (enterFrame) {  
function fadeOut() {  
if (this.\_alpha\>50) {  
this.\_alpha -= 50;  
} else {  
this.onEnterFrame = null;  
}  
}  
function fadeIn() {  
if (this.\_alpha\<100) {  
this.\_alpha += 50;  
} else {  
this.onEnterFrame = null;  
}  
}  
this.onRollOver = function() {  
this.onEnterFrame = fadeOut;  
};  
this.onRollOut = function() {  
this.onEnterFrame = fadeIn;  
};

}[/AS]

Thanks for your help. I’d be shagged if it wasn’t for this forum, you are a great help. I appreciate every reply,

Cheers,  
Brian
