# This.onMouseInactive \<-- ? or something like it

**URL:** <https://forum.kirupa.com/t/this-onmouseinactive-or-something-like-it/164139>\
**Category:** Uncategorized\
**Created:** [September 28, 2005, 7:52pm UTC](https://forum.kirupa.com/t/this-onmouseinactive-or-something-like-it/164139 "2005-09-28T19:52:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![developmental](https://avatars.discourse-cdn.com/v4/letter/d/9de053/32.png) [@developmental](https://forum.kirupa.com/u/developmental)\
**Post date:** [September 28, 2005, 7:52pm UTC](https://forum.kirupa.com/t/this-onmouseinactive-or-something-like-it/164139/1 "2005-09-28T19:52:00Z")

</div>

I am attempting to have a mc fade in onMouseMove and fade out once the mouse becomes inactive.

```auto

close_mc._alpha =0;
mouse_timeoutMS = 2000;
this.onMouseMove = function() {
	clearInterval(itvMouseID);
	this.onEnterFrame = function() {
		if (close_mc._alpha<100) {
			close_mc._alpha += 10;
		}
	};
	if (close_mc._alpha == 100) {
		delete onEnterFrame;
		itvMouseID = setInterval(fade_out, mouse_timeoutMS);
	}
};
fade_out = function () {
	clearInterval(itvMouseID);
	this.onEnterFrame = function() {
		if (close_mc._alpha>0) {
			close_mc._alpha += 10;
		}
	};
	if (close_mc._alpha == 0) {
		delete onEnterFrame;
	}
};

```

FILES  
[html](http://130public.net/test_area/mouse_move/mouse_move.html)[url=“[http://130public.net/test\_area/mouse\_move/mouse\_move.swf](http://130public.net/test_area/mouse_move/mouse_move.swf)”]  
swf  
[fla (zipped)](http://130public.net/test_area/mouse_move/mouse_move.zip)
