# Easy Button Question

**URL:** <https://forum.kirupa.com/t/easy-button-question/10898>\
**Category:** flash\
**Created:** [January 9, 2003, 1:59am UTC](https://forum.kirupa.com/t/easy-button-question/10898 "2003-01-09T01:59:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zcarrington1](https://avatars.discourse-cdn.com/v4/letter/z/3ec8ea/32.png) [@zcarrington1](https://forum.kirupa.com/u/zcarrington1)\
**Post date:** [January 9, 2003, 1:59am UTC](https://forum.kirupa.com/t/easy-button-question/10898/1 "2003-01-09T01:59:52Z")

</div>

Hey Everybody, here’s an easy one.

I need to make a button fade out to almost transparent and then fully fade in when the mouse is moved over it.

This is my first attemp at doing things without a tutorial and I can’t quite figure the code out, but I know one of you guys can help me.

Much appreciation…:beam:

---

<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:** [January 9, 2003, 7:30am UTC](https://forum.kirupa.com/t/easy-button-question/10898/2 "2003-01-09T07:30:57Z")

</div>

```auto

onClipEvent (enterFrame) {
	if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
		alpha = 100
	} else {
		alpha = 20
	}
	this._alpha += (alpha - this._alpha) / 4
}

```

since you seem like a smart guy … use the actionscript dictionary to find out how the code works :beam:

by the way … don’t use a button … use a movie clip instead

[size=1]if you place those actions in a button flash will throw an error like this:  
clip events are permitted only for movie clip instances bla … bla … bla .[/size]

---

<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:** [January 9, 2003, 11:13am UTC](https://forum.kirupa.com/t/easy-button-question/10898/3 "2003-01-09T11:13:15Z")

</div>

Use a button handler with your movie clip, instead of an enterFrame+hitTest.

theClip.onRollOver=function(){…}

---

<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:** [January 9, 2003, 1:17pm UTC](https://forum.kirupa.com/t/easy-button-question/10898/4 "2003-01-09T13:17:02Z")

</div>

Thanks fellas…It actually dawned on me as soon as I logged off  
last night. I used the button handlers but I was actually looking for  
code more like Kax’s. I may switch to that. Thanks again…
