# \[FMX\] question about onCLipEvent

**URL:** <https://forum.kirupa.com/t/fmx-question-about-onclipevent/34657>\
**Category:** flash\
**Created:** [November 4, 2003, 11:00pm UTC](https://forum.kirupa.com/t/fmx-question-about-onclipevent/34657 "2003-11-04T23:00:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maizoon](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@Maizoon](https://forum.kirupa.com/u/Maizoon)\
**Post date:** [November 4, 2003, 11:00pm UTC](https://forum.kirupa.com/t/fmx-question-about-onclipevent/34657/1 "2003-11-04T23:00:23Z")

</div>

Hello,

I have the following script on a movie clip which fades the clip in when your mouse is over the MC and fades it out when your mouse moves off. It works fine, but it “flickers” when its faded in all the way. How can I stop that?

[AS]

onClipEvent (enterFrame) {  
if (this.hitTest(\_root.\_xmouse, \_root.\_ymouse)) {  
this.onEnterFrame = function() {  
if (this.\_alpha\<80) {  
this.\_alpha += 3;  
} else {  
this.\_alpha = 80;  
delete this.onEnterFrame;  
}  
};  
} else {  
this.onEnterFrame = function() {  
if (this.\_alpha\>40) {  
this.\_alpha -= 3;  
} else {  
this.\_alpha = 40;  
delete this.onEnterFrame;  
}  
};  
}  
}

[/AS]

---

<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:** [November 4, 2003, 11:36pm UTC](https://forum.kirupa.com/t/fmx-question-about-onclipevent/34657/2 "2003-11-04T23:36:06Z")

</div>

Ok, the problem is that when you set something like an alpha, or even an \_x or \_y, Its not EXACTLY EXACTLY the same number to the N’th decimal.  
Just replace  
this.\_alpha = 80;  
with  
this.\_alpha = 81;

set up a trace, or a textbox with the 81 and without the 81… so you can see that when the alpha of your MC is set the old way its bouncing back and forth between like 78 - 81.
