# onMouseMove alpha transparency

**URL:** <https://forum.kirupa.com/t/onmousemove-alpha-transparency/254330>\
**Category:** Uncategorized\
**Created:** [March 11, 2008, 12:17am UTC](https://forum.kirupa.com/t/onmousemove-alpha-transparency/254330 "2008-03-11T00:17:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fatbat](https://avatars.discourse-cdn.com/v4/letter/f/9e8a1a/32.png) [@Fatbat](https://forum.kirupa.com/u/Fatbat)\
**Post date:** [March 11, 2008, 12:17am UTC](https://forum.kirupa.com/t/onmousemove-alpha-transparency/254330/1 "2008-03-11T00:17:25Z")

</div>

Hello. I’ve got a horizontal bar on the screen following the mouse vertical motion. I would like for it to be transparent until the mouse moves, and then fade in to be 100% on mouse movement. When the mouse stops moving, I would like it to fade back to be 0% transparent after a couple of seconds.

Does anyone here know where there might be an example of such a thing? Or can you perhaps help with some code here?

This what I have for the mouse follow on the bar MC…

onClipEvent (load) {  
\_y = 0;  
speed = 10;  
}  
onClipEvent (enterFrame) {  
endY = \_root.\_ymouse;  
\_y += (endY-\_y)/speed;  
}
