# Grow and Shrink Mouse?

**URL:** <https://forum.kirupa.com/t/grow-and-shrink-mouse/260444>\
**Category:** flash\
**Created:** [May 15, 2008, 5:29pm UTC](https://forum.kirupa.com/t/grow-and-shrink-mouse/260444 "2008-05-15T17:29:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jschelling](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@jschelling](https://forum.kirupa.com/u/jschelling)\
**Post date:** [May 15, 2008, 5:29pm UTC](https://forum.kirupa.com/t/grow-and-shrink-mouse/260444/1 "2008-05-15T17:29:16Z")

</div>

Ok so i have a custom mouse on my site, and now im trying to make it so that the mouse grows and shrinks depending on where it is on the screen. Example : The mouse is at the bottom of the screen so it is bigger, the mouse is at the top of the screen so it is smaller with consistent fluctuation between. Or, The mouse is regular size at top bottom left and right and all other edges of screen, but as it moves closer to the middle it shrinks. Any help on how to do this? :ear:

---

<div class="post-metadata">

**Author:** ![onion](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/onion/32/3349_2.png) [@onion](https://forum.kirupa.com/u/onion)\
**Post date:** [May 15, 2008, 8:44pm UTC](https://forum.kirupa.com/t/grow-and-shrink-mouse/260444/2 "2008-05-15T20:44:21Z")

</div>

Use the \_ymouse and \_xmouse to your advantage. Lets say you wanted your mouse to grown when you go to the bottom of the screen, it would be larger when the \_ymouse is greater.

So I’m assuming that your custom mouse is just a movieclip that is either being dragged, or continuously positioning itself at the \_ymouse and \_xmouse right?

So heres my example: You have a object on the screen called “circle”. Put this code on the frame.

```auto
circle.onEnterFrame = function(){
    //---position the object to the mouse's position
    this._y = _ymouse
    this._x = _xmouse
    
    //---now scale the object based on the mouse's y position
    this._yscale = _ymouse * 0.5
    this._xscale = _ymouse * 0.5
}

```

I have used 0.5 as the multiplied because didnt want it to get too big, but you can use whatever you want.

Hope this helps!
