# A noob's venture into switching between multiple different custom cursors

**URL:** <https://forum.kirupa.com/t/a-noobs-venture-into-switching-between-multiple-different-custom-cursors/264579>\
**Category:** flash\
**Created:** [June 27, 2008, 1:33pm UTC](https://forum.kirupa.com/t/a-noobs-venture-into-switching-between-multiple-different-custom-cursors/264579 "2008-06-27T13:33:10Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![josefgiven](https://avatars.discourse-cdn.com/v4/letter/j/7feea3/32.png) [@josefgiven](https://forum.kirupa.com/u/josefgiven)\
**Post date:** [June 27, 2008, 1:33pm UTC](https://forum.kirupa.com/t/a-noobs-venture-into-switching-between-multiple-different-custom-cursors/264579/1 "2008-06-27T13:33:10Z")

</div>

Hi folks,

I know about tricks like this:

```auto
onClipEvent(load)
{
Mouse.hide();
this.startDrag();
}

```

…for customising the mouse cursor. I’d like to ask for your help with more advanced cursor trickery.

I have five movie clips, each for the mouse cursor in different states. The first is for when the mouse is moving at anything from static to average speed; the other four are for when the mouse is moved very swiftly from left to right, right to left, up to down, and down to up, respectively. These are the two things I need to ask you:[LIST=1]  
[_]How do you detect when the user moves the cursor very swiftly in the x axis? (and also y)  
[_]Triggered by fast movement as above, how do you tell the mouse pointer to change to, and play, the corresponding movie clip, before returning to the static state pointer?  
[/LIST]Thanks for your time,

Steve

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [June 27, 2008, 1:43pm UTC](https://forum.kirupa.com/t/a-noobs-venture-into-switching-between-multiple-different-custom-cursors/264579/2 "2008-06-27T13:43:43Z")

</div>

What is the effects on the mouse icon out of interest?

you may be able to do it with AS to make things simple

---

<div class="post-metadata">

**Author:** ![josefgiven](https://avatars.discourse-cdn.com/v4/letter/j/7feea3/32.png) [@josefgiven](https://forum.kirupa.com/u/josefgiven)\
**Post date:** [June 27, 2008, 2:14pm UTC](https://forum.kirupa.com/t/a-noobs-venture-into-switching-between-multiple-different-custom-cursors/264579/3 "2008-06-27T14:14:23Z")

</div>

Well the _desired_ effect is to make the cursor like a long, flexible pointer. So it flexes out of shape as it’s swished in one direction, then snaps back into shape when it’s brought to a halt.

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [June 27, 2008, 2:31pm UTC](https://forum.kirupa.com/t/a-noobs-venture-into-switching-between-multiple-different-custom-cursors/264579/4 "2008-06-27T14:31:54Z")

</div>

mouse trail,  
eyeball, follow mouse

without uber flash skills its hard to see how you will create what I imagine you want

useful zippy code

> **[Flash 6 vs flash 8](https://www.kirupa.com/forum/showthread.php?t=301803)**
>
> Got a web design/development question or just want to hang out with the most awesome people on the planet? Drop on in!

---

<div class="post-metadata">

**Author:** ![Sendoushi](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Sendoushi](https://forum.kirupa.com/u/Sendoushi)\
**Post date:** [June 27, 2008, 2:50pm UTC](https://forum.kirupa.com/t/a-noobs-venture-into-switching-between-multiple-different-custom-cursors/264579/5 "2008-06-27T14:50:18Z")

</div>

josefgiven if you already know Mouse.hide(); you have done most of the job 🙂 you don’t need drag and the onclipevent isn’t the most correct.

you have to do two things.  
0 - the theory  
Just a simple introduction to the code you need to do.  
The basics is simple, whenever the mouse moves, a graphic will to, to the same place of the mouse position.  
So… how to do it?

1st - the mc movement  
now, you have the graphics that you want to replace the mouse with inside a movieclip.  
name it for example mouse\_mc (on instance).  
now you just have to apply something like:  
// this will get the cartesian X from the mouse and will move the mouse\_mc to that same X  
mouse\_mc.\_x == \_xmouse ;  
// and this line will do the same for the Y value  
mouse\_mc.\_y == \_ymouse;

2nd - The final code

mouse\_mc.\_x == \_xmouse;  
mouse\_mc.\_y == \_ymouse;

I would put this on a timeline frame but not one with animation on it. I would for example made a Movieclip (named mouse\_mc\_out for example) with the mouse\_mc inside of it and put this code on the only frame avaiable on mouse\_mc\_out this code:  
this.mouse\_mc.\_x == \_xmouse;  
this.mouse\_mc.\_y == \_ymouse;

so it will path something like : inside of this mouse\_mc\_out (pathing to it with “this”) there is a movieclip named mouse\_mc , i want that movieclip to move to the mouse position  
as simple as this.

---

<div class="post-metadata">

**Author:** ![pantas](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@pantas](https://forum.kirupa.com/u/pantas)\
**Post date:** [June 27, 2008, 3:26pm UTC](https://forum.kirupa.com/t/a-noobs-venture-into-switching-between-multiple-different-custom-cursors/264579/6 "2008-06-27T15:26:57Z")

</div>

something missing…  
that will not make it move…

this.onMouseMove = function(){  
mouse\_mc.\_x == \_xmouse;  
mouse\_mc.\_y == \_ymouse;  
}

---

<div class="post-metadata">

**Author:** ![Sendoushi](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Sendoushi](https://forum.kirupa.com/u/Sendoushi)\
**Post date:** [June 27, 2008, 4:06pm UTC](https://forum.kirupa.com/t/a-noobs-venture-into-switching-between-multiple-different-custom-cursors/264579/7 "2008-06-27T16:06:43Z")

</div>

same stupid error that i had on my code ehehe… but yes pantas is right…

---

<div class="post-metadata">

**Author:** ![josefgiven](https://avatars.discourse-cdn.com/v4/letter/j/7feea3/32.png) [@josefgiven](https://forum.kirupa.com/u/josefgiven)\
**Post date:** [June 27, 2008, 6:51pm UTC](https://forum.kirupa.com/t/a-noobs-venture-into-switching-between-multiple-different-custom-cursors/264579/8 "2008-06-27T18:51:01Z")

</div>

Wow, thanks fellas. 🙂 I’ll let you know how I get on…

---

<div class="post-metadata">

**Author:** ![josefgiven](https://avatars.discourse-cdn.com/v4/letter/j/7feea3/32.png) [@josefgiven](https://forum.kirupa.com/u/josefgiven)\
**Post date:** [June 27, 2008, 10:15pm UTC](https://forum.kirupa.com/t/a-noobs-venture-into-switching-between-multiple-different-custom-cursors/264579/9 "2008-06-27T22:15:44Z")

</div>

Okay, so I’ve given it a try, but no success yet.

Let me recap on what I did. I’ve uploaded the trial run Flash file as… well, Trial.fla.

I’ve made an ultra-basic moving shape in the main scene just to have something going on in the background.

So I’ve got two movie clips: one **mouse\_mc** and one **mouse\_mc\_out**. mouse\_mc has been dragged into mouse\_mc\_out. In the first and only frame of mouse\_mc\_out this Actionscript code has been added:

```auto
this.onMouseMove = function(){
mouse_mc._x == _xmouse;
mouse_mc._y == _ymouse;
}

```

Please forgive my utter n00bery, btw.

Thanks again,

Steve 🙂

---

<div class="post-metadata">

**Author:** ![Sendoushi](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Sendoushi](https://forum.kirupa.com/u/Sendoushi)\
**Post date:** [June 28, 2008, 12:18pm UTC](https://forum.kirupa.com/t/a-noobs-venture-into-switching-between-multiple-different-custom-cursors/264579/10 "2008-06-28T12:18:21Z")

</div>

so it worked right?
