Mouse speed

Is there a way to know the speed of a mouse or how long a mouse is over a movieclip?

Coz i have a movieclip that if I rolled over it for a specific period of seconds, it shows a picture but if the movieclip was just passed over a second, it won’t show the picture.

Need help badly

you can add a timer and an if statement which checks if the mouse is over the movieclip. if it is then increment the timer. when the timer reaches a certain numbr then gotoAndPlay to the frame with the new pic. when the mouse leaves the movieclip then reset the timer to zero. does that help?

put this script in the maintimeline

[AS]timer = 0;
amountOfTime = 48;
onEnterFrame = function () {
if (pic.hitTest(_xmouse, _ymouse, true)) {
timer++;
if (timer>amountOfTime) {
pic.gotoAndStop(2);
}
} else {
timer = 0;
pic.gotoAndStop(1)
}
};[/AS]

pic refers to the MC you want to add the action to. when the mouse is over the movei clip, the the timer increments and checks whether it timer has reached ‘amountOfTime’ which is set as 48. this would be two seconds when using 24 fps. Once timer has reached the amountOfTime then pic goesToAnStops on the next frame which has a new image. then an else statement tells the pic to go back to the first frame and resets timer… hope that explains it all :slight_smile:

zylum

ps, heres a fla if you need it