Solved

how to calculate the mouse speed?

Posted on 2003-11-27
3
734 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
ID: 9835423
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
ID: 9835430
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
ID: 9840800
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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HTML 5 or Flash 7 486
How to convert pdf file to html file 8 395
Google Chrome Blank White Screens 13 300
Adobe Flash Player won't install on Windows 7 3 242
This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

803 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