# Ease alpha with hittest

**URL:** <https://forum.kirupa.com/t/ease-alpha-with-hittest/248187>\
**Category:** Uncategorized\
**Created:** [January 4, 2008, 7:55pm UTC](https://forum.kirupa.com/t/ease-alpha-with-hittest/248187 "2008-01-04T19:55:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubbersquirrel](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@rubbersquirrel](https://forum.kirupa.com/u/rubbersquirrel)\
**Post date:** [January 4, 2008, 7:55pm UTC](https://forum.kirupa.com/t/ease-alpha-with-hittest/248187/1 "2008-01-04T19:55:08Z")

</div>

hey. im using the hittest code from senocular to make a menu fade out. it’s working but i was wondering if someone could explain how i could add ease to the alpha. i’ve tried implementing some of the ease codes found on here but havn’t had any luck. thanks.

```php
black.isPressed = false; // flag
black.isOver = false; // flag

black.onMouseMove = function(){
    var lastIsOver = this.isMouseOver;
    if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
        this.isMouseOver = true;
        if (this.isMouseOver != lastIsOver){
            if (this.isPressed){
                this._alpha = 0;
            }else{
                this._alpha = 0;
            }
        }
    }else{
        this.isMouseOver = false;
        if (this.isMouseOver != lastIsOver){
            if (this.isPressed){
                this._alpha += 90;
            }else{
                this._alpha += 90;
            }
        }
    }
}

```
