# If/else arguement not working

**URL:** <https://forum.kirupa.com/t/if-else-arguement-not-working/258933>\
**Category:** Uncategorized\
**Created:** [April 29, 2008, 5:26pm UTC](https://forum.kirupa.com/t/if-else-arguement-not-working/258933 "2008-04-29T17:26:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![East\_High](https://avatars.discourse-cdn.com/v4/letter/e/6de8d8/32.png) [@East\_High](https://forum.kirupa.com/u/East_High)\
**Post date:** [April 29, 2008, 5:26pm UTC](https://forum.kirupa.com/t/if-else-arguement-not-working/258933/1 "2008-04-29T17:26:54Z")

</div>

The if bit works, but the else doesn’t. I’m guessing it’s something to do with the hitTest code. I’m just trying to script a simple button. Can anyone help a rusty AS’er? :-/

```auto

button_mc.onRollOver = function() {
    if (this.hitTest(_root._xmouse, _root._ymouse) == true) {
        this.gotoAndStop(2);
        trace("on");
    } else {
        this.gotoAndStop(1);
        trace("off");
    }
};

```
