# \_ymouse and \_alpha?

**URL:** https://forum.kirupa.com/t/-ymouse-and--alpha/270949
**Category:** Uncategorized
**Created:** [September 16, 2008, 4:11pm UTC](https://forum.kirupa.com/t/-ymouse-and--alpha/270949 "2008-09-16T16:11:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![manny2k](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@manny2k](https://forum.kirupa.com/u/manny2k)
#### Post date: [September 16, 2008, 4:11pm UTC](https://forum.kirupa.com/t/-ymouse-and--alpha/270949/1 "2008-09-16T16:11:26Z")

</div>

Hi

I have a Mc named globalNav\_mc and what I’m trying to do is get the \_alpha of that clip to increase and decrease in relation to the \_y position of the mouse but in in increments

So for example as the \_ymouse gets closer to 0 the clips \_alpha will get closer to 100 and the further away the clips \_alpha will get closer to 0, its getting the \_alpha to go up in increments that I’m having trouble with, any pointers would be a great help, this is what I have so far

```php
 var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {
trace(_ymouse);
    if (_ymouse > Stage.height/2) {
        globalNav_mc._alpha = 50;
    } else if (_ymouse< Stage.height/2) {
        globalNav_mc._alpha = 100;
    }
    
};
Mouse.addListener(mouseListener); 

```

Cheers

manny
