Solved

how to calculate the mouse speed?

Posted on 2003-11-27
3
726 Views
Last Modified: 2007-12-19
hi, everyone
 now, i can use actionscript to get mouse x and y position, and i try alot of methods, still can't get the mouse speed. can anyone tell me how to do that?

ps: i want to get mouse speed. so that i can know users move their mouse fast or slow.
0
Comment
Question by:justice_ong
3 Comments
 
LVL 9

Expert Comment

by:OBCT
Comment Utility
First we'll need to know a few things before we can take this any further...
How do you want the mouse speed to be measured?
How do you plan on storing the information?

The only way I could think of doing this is by running a trace on the mouse co-ordinats and by running a timer to calculate the time it takes for the user to move from pixel to pixel, then calculating the average time and have that stored in an online database...

Cheers

-OBCT
0
 

Author Comment

by:justice_ong
Comment Utility
ya..i have used timer. but the problem is i always get the result zero..
0
 
LVL 27

Accepted Solution

by:
negatyve earned 75 total points
Comment Utility
try this on a movieclip:

onClipEvent(enterFrame){
      trace(Math.round(Math.abs(_root._xmouse - this.oldx)));
      trace(Math.round(Math.abs(_root._ymouse - this.oldy)));
      this.oldx = _root._xmouse;
      this.oldy = _root._ymouse;
}
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now