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

Hi folks,

I know about tricks like this:

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

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

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

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.

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

josefgiven if you already know Mouse.hide(); you have done most of the job :slight_smile: 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.

something missing…
that will not make it move…

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

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

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

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:

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

Please forgive my utter n00bery, btw.

Thanks again,

Steve :slight_smile:

so it worked right?