# Help me make this thing follow the mouse

**URL:** <https://forum.kirupa.com/t/help-me-make-this-thing-follow-the-mouse/63098>\
**Category:** Uncategorized\
**Created:** [September 2, 2004, 11:15pm UTC](https://forum.kirupa.com/t/help-me-make-this-thing-follow-the-mouse/63098 "2004-09-02T23:15:04Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![berkoWitZ](https://avatars.discourse-cdn.com/v4/letter/b/b9bd4f/32.png) [@berkoWitZ](https://forum.kirupa.com/u/berkoWitZ)\
**Post date:** [September 2, 2004, 11:15pm UTC](https://forum.kirupa.com/t/help-me-make-this-thing-follow-the-mouse/63098/1 "2004-09-02T23:15:04Z")

</div>

hi, please check this out: [here!](http://www.framecreation.com/fuel.swf)

I need to make the arrow follow the mouse when I move it throught the bottons, now is moving but with a predetermined move, to be honest I dont have a clue, I searched but no luck, maybe someone can help me or point me out to a tutorial, thanks!

---

<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:** [September 3, 2004, 4:36am UTC](https://forum.kirupa.com/t/help-me-make-this-thing-follow-the-mouse/63098/2 "2004-09-03T04:36:27Z")

</div>

do you want to do it with easing or what?

---

<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:** [September 3, 2004, 3:30pm UTC](https://forum.kirupa.com/t/help-me-make-this-thing-follow-the-mouse/63098/3 "2004-09-03T15:30:24Z")

</div>

yes with easing would be great, any ideas? and thanks for replying…

---

<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:** [September 3, 2004, 3:36pm UTC](https://forum.kirupa.com/t/help-me-make-this-thing-follow-the-mouse/63098/4 "2004-09-03T15:36:24Z")

</div>

You want this one:

[http://www.kirupa.com/developer/mx/followease.htm](http://www.kirupa.com/developer/mx/followease.htm)

Note: the example on the site doesnt’ seem to work in Firefox ☹ but the code is still the same and works fine.

---

<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:** [September 3, 2004, 4:10pm UTC](https://forum.kirupa.com/t/help-me-make-this-thing-follow-the-mouse/63098/5 "2004-09-03T16:10:22Z")

</div>

ok that helped but I dont want to make the arrow follow me around, how can I make that the arrow stays in place and just move like in the example in the first post, in a define area, I dont know if I explained it well…

---

<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:** [September 3, 2004, 4:52pm UTC](https://forum.kirupa.com/t/help-me-make-this-thing-follow-the-mouse/63098/6 "2004-09-03T16:52:47Z")

</div>

Oh sorry, what you need is something that eases the needle to the button on rollover. For that you should use Voetsjoeba’s patented easing formula:

```auto

 MovieClip.prototype.ease = function(x,y){
   this.onEnterFrame = function(){
     this._x = x-(x-this._x)/1.1;
     this._y = y-(y-this._y)/1.1
       if(this._x > x-1 && this._x < x+1 && this._y > y-1 && this._y < y+1){
            this._x = x;
            this._y = y;
            delete this.onEnterFrame
            //do other stuff here, this is the point at which the object reaches its target
                 }
         }
 }
 MC.ease(100,100);

```

where MC would be the name of the needle and the coordinates are for the button you want the needle to ease to. Put the AS on the maintimeline but call the function on rollover of your button. Also, instead of hard numbers for the coordinates you can use the \_x and \_y positions of your button - that way if you ever move the buttons around you don’t have to worry about changing those numbers. Note - if you do it that way you should make your registration point of your button at the center.

Cool nav idea by the way :thumb:

Hope this helps!

:hr:

---

<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:** [September 3, 2004, 5:08pm UTC](https://forum.kirupa.com/t/help-me-make-this-thing-follow-the-mouse/63098/7 "2004-09-03T17:08:35Z")

</div>

thanks lunatic, I put the AS on the main timeline and changed the name of the MC but I dont now how to call the function when I rollover the button…? :puzzled: Teach me please! :trout:

---

<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:** [September 3, 2004, 5:22pm UTC](https://forum.kirupa.com/t/help-me-make-this-thing-follow-the-mouse/63098/8 "2004-09-03T17:22:00Z")

</div>

> [@berkoWitZ](#):
>
> thanks lunatic, I put the AS on the main timeline and changed the name of the MC but I dont now how to call the function when I rollover the button…? :puzzled: Teach me please! :trout:

I may be wrong, but i don`t think that is going to work. I think you really need to look at \_rotation. Have a look at this and see if it helps.

---

<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:** [September 3, 2004, 6:11pm UTC](https://forum.kirupa.com/t/help-me-make-this-thing-follow-the-mouse/63098/9 "2004-09-03T18:11:32Z")

</div>

stringy…u rock! u solve my problem, thanks a lot! and thanks lunatic for helping me too 😉

---

<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:** [September 3, 2004, 6:19pm UTC](https://forum.kirupa.com/t/help-me-make-this-thing-follow-the-mouse/63098/10 "2004-09-03T18:19:22Z")

</div>

😊 Ack Stringy is right. I forgot the needle has one end that moves and the other end stays stationary. That makes it more difficult. Well, not more difficult but requires more math. :ro:

Sorry I couldn’t help ☹

---

<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:** [September 3, 2004, 6:26pm UTC](https://forum.kirupa.com/t/help-me-make-this-thing-follow-the-mouse/63098/11 "2004-09-03T18:26:34Z")

</div>

haha, thanks anyways, I always keep track of the people that help me to help them later if I can 😉

---

<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:** [September 3, 2004, 6:28pm UTC](https://forum.kirupa.com/t/help-me-make-this-thing-follow-the-mouse/63098/12 "2004-09-03T18:28:34Z")

</div>

Glad it helped.  
Lunatic had already done too many good answers this week anyway.

---

<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:** [September 3, 2004, 6:31pm UTC](https://forum.kirupa.com/t/help-me-make-this-thing-follow-the-mouse/63098/13 "2004-09-03T18:31:58Z")

</div>

Yeah, mostly in Random 😛

but thanks stringy - you’ve been really on top of stuff recently! Every time I go to try and help someone it seems like I’m 5 minutes behind you! :love:
