Re: [Flashcoders] pixel-accurate _xmouse tracking?
I've done some tests in AS3, and the response is definitely better. Not pixel-accurate, as you all have noted, but definitely way more granular than in AS2... .m On Wed, Mar 12, 2008 at 4:42 PM, Allandt Bik-Elliott (Receptacle) <[EMAIL PROTECTED]> wrote: > if you use updateAfterEvent() in your mouseMove event, you will get > it as quick as the flash player will allow, irrespective of the > framerate but you still won't get even close to every 10th pixel if > the user gives it some welly > > as3 does execute about 10 times faster (so they say - i'm sure > someone here has a real-world amount there) so, yes, in theory - you > would get a better response but bare in mind, it's still limited > > if you need to track the mouse over large distances it may be worth > your while to look at using javascript to get the mouse point from > outside the flash movie (for a spank the monkey style game - see > http://www.blitzgamer.com/play_games/miscellaneous/316/spank-the- > monkey.html for the example) and then pass it to flash for the result. > > > > > On 12 Mar 2008, at 20:07, Matt S. wrote: > > > Is this something where AS3 would be superior to AS2? I know its > > faster generally, can one expect better responsiveness here as well? > > > > .m > > > > On Wed, Mar 12, 2008 at 12:08 PM, Kerry Thompson > > <[EMAIL PROTECTED]> wrote: > >> > >> Matt S. wrote: > >> > >>> can anyone recommend a way to have pixel-accurate mouse tracking? > >>> If I > >>> move my mouse slowly it pretty much grabs them all, but any fast > >>> movements result in huge gaps in the _xmouse tracking, so instead of > >>> being 1,2,3,4,5,6,7,8,9,10,11,12 etc, it'll be > >>> 1,4,6,9,12,15,16,23,30,35, etc. I need it it to be as accurate as > >>> possible. Can this be done? > >> > >> Nope. I can't even get that in my C++ programs, and C++ runs up > >> to 100 times > >> faster than Flash, maybe more. > >> > >> It's not really a Flash or C++ problem, anyway--it's a Windows > >> problem. > >> Windows sends a MOUSE_MOVE message whenever it can, but there is > >> no way it > >> can keep up if you zip across 2,000 pixels in 1/10 second. > >> > >> You'll see the same thing in any paint program, or, for that > >> matter, on > >> those electronic signature pads at the store. Ok, the signature pads > >> probably use left-over 6502s, but even a fast processor can't > >> keep up when > >> you zip across the screen. > >> > >> You might try some sort of interpolation algorithm if you need > >> every pixel, > >> like in a drawing program. > >> > >> Cordially, > >> > >> Kerry Thompson > >> > >> > >> > >> > >> ___ > >> Flashcoders mailing list > >> Flashcoders@chattyfig.figleaf.com > >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > >> > > ___ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] pixel-accurate _xmouse tracking?
if you use updateAfterEvent() in your mouseMove event, you will get it as quick as the flash player will allow, irrespective of the framerate but you still won't get even close to every 10th pixel if the user gives it some welly as3 does execute about 10 times faster (so they say - i'm sure someone here has a real-world amount there) so, yes, in theory - you would get a better response but bare in mind, it's still limited if you need to track the mouse over large distances it may be worth your while to look at using javascript to get the mouse point from outside the flash movie (for a spank the monkey style game - see http://www.blitzgamer.com/play_games/miscellaneous/316/spank-the- monkey.html for the example) and then pass it to flash for the result. On 12 Mar 2008, at 20:07, Matt S. wrote: Is this something where AS3 would be superior to AS2? I know its faster generally, can one expect better responsiveness here as well? .m On Wed, Mar 12, 2008 at 12:08 PM, Kerry Thompson <[EMAIL PROTECTED]> wrote: Matt S. wrote: can anyone recommend a way to have pixel-accurate mouse tracking? If I move my mouse slowly it pretty much grabs them all, but any fast movements result in huge gaps in the _xmouse tracking, so instead of being 1,2,3,4,5,6,7,8,9,10,11,12 etc, it'll be 1,4,6,9,12,15,16,23,30,35, etc. I need it it to be as accurate as possible. Can this be done? Nope. I can't even get that in my C++ programs, and C++ runs up to 100 times faster than Flash, maybe more. It's not really a Flash or C++ problem, anyway--it's a Windows problem. Windows sends a MOUSE_MOVE message whenever it can, but there is no way it can keep up if you zip across 2,000 pixels in 1/10 second. You'll see the same thing in any paint program, or, for that matter, on those electronic signature pads at the store. Ok, the signature pads probably use left-over 6502s, but even a fast processor can't keep up when you zip across the screen. You might try some sort of interpolation algorithm if you need every pixel, like in a drawing program. Cordially, Kerry Thompson ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] pixel-accurate _xmouse tracking?
Is this something where AS3 would be superior to AS2? I know its faster generally, can one expect better responsiveness here as well? .m On Wed, Mar 12, 2008 at 12:08 PM, Kerry Thompson <[EMAIL PROTECTED]> wrote: > > Matt S. wrote: > > > can anyone recommend a way to have pixel-accurate mouse tracking? If I > > move my mouse slowly it pretty much grabs them all, but any fast > > movements result in huge gaps in the _xmouse tracking, so instead of > > being 1,2,3,4,5,6,7,8,9,10,11,12 etc, it'll be > > 1,4,6,9,12,15,16,23,30,35, etc. I need it it to be as accurate as > > possible. Can this be done? > > Nope. I can't even get that in my C++ programs, and C++ runs up to 100 times > faster than Flash, maybe more. > > It's not really a Flash or C++ problem, anyway--it's a Windows problem. > Windows sends a MOUSE_MOVE message whenever it can, but there is no way it > can keep up if you zip across 2,000 pixels in 1/10 second. > > You'll see the same thing in any paint program, or, for that matter, on > those electronic signature pads at the store. Ok, the signature pads > probably use left-over 6502s, but even a fast processor can't keep up when > you zip across the screen. > > You might try some sort of interpolation algorithm if you need every pixel, > like in a drawing program. > > Cordially, > > Kerry Thompson > > > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] pixel-accurate _xmouse tracking?
yeah, I dont actually need it to be pixel accurate down to the single pixel. If I could get it consistently accurate to within 25 pixels I'd be set. It seems like if the mouse is moving fast enough even 25px is too much though. Anyhoo, I'll keep workin on it... thx, .m On Wed, Mar 12, 2008 at 11:33 AM, Zeh Fernando <[EMAIL PROTECTED]> wrote: > This IS as accurate as possible. Technically, your mouse never was on 2, > 3, 5, 7, 8, etc. Remember mouse reading on the hardware works at a > certain frequency, and everything in between is lost. > > You can always interpolate between read values. That'll give you the > "imtermediary" positions where the mouse was. > > If your data is EXTREMELY inaccurate, though, using updateAfterEvent() > inside mouseMove events (or AS3's equivalent) allow you to read as many > values as physically possible. > > Zeh > > > > Matt S. wrote: > > Hi, > > can anyone recommend a way to have pixel-accurate mouse tracking? If I > > move my mouse slowly it pretty much grabs them all, but any fast > > movements result in huge gaps in the _xmouse tracking, so instead of > > being 1,2,3,4,5,6,7,8,9,10,11,12 etc, it'll be > > 1,4,6,9,12,15,16,23,30,35, etc. I need it it to be as accurate as > > possible. Can this be done? > > > > .m > > > > ___ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] pixel-accurate _xmouse tracking?
Matt S. wrote: > can anyone recommend a way to have pixel-accurate mouse tracking? If I > move my mouse slowly it pretty much grabs them all, but any fast > movements result in huge gaps in the _xmouse tracking, so instead of > being 1,2,3,4,5,6,7,8,9,10,11,12 etc, it'll be > 1,4,6,9,12,15,16,23,30,35, etc. I need it it to be as accurate as > possible. Can this be done? Nope. I can't even get that in my C++ programs, and C++ runs up to 100 times faster than Flash, maybe more. It's not really a Flash or C++ problem, anyway--it's a Windows problem. Windows sends a MOUSE_MOVE message whenever it can, but there is no way it can keep up if you zip across 2,000 pixels in 1/10 second. You'll see the same thing in any paint program, or, for that matter, on those electronic signature pads at the store. Ok, the signature pads probably use left-over 6502s, but even a fast processor can't keep up when you zip across the screen. You might try some sort of interpolation algorithm if you need every pixel, like in a drawing program. Cordially, Kerry Thompson ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] pixel-accurate _xmouse tracking?
This IS as accurate as possible. Technically, your mouse never was on 2, 3, 5, 7, 8, etc. Remember mouse reading on the hardware works at a certain frequency, and everything in between is lost. You can always interpolate between read values. That'll give you the "imtermediary" positions where the mouse was. If your data is EXTREMELY inaccurate, though, using updateAfterEvent() inside mouseMove events (or AS3's equivalent) allow you to read as many values as physically possible. Zeh Matt S. wrote: Hi, can anyone recommend a way to have pixel-accurate mouse tracking? If I move my mouse slowly it pretty much grabs them all, but any fast movements result in huge gaps in the _xmouse tracking, so instead of being 1,2,3,4,5,6,7,8,9,10,11,12 etc, it'll be 1,4,6,9,12,15,16,23,30,35, etc. I need it it to be as accurate as possible. Can this be done? .m ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] pixel-accurate _xmouse tracking?
The problem you're having is that the mouse is traveling at a faster rate than one pixel per frame. So the coordinates you get back are the coordinates that the mouse was on each time the script was executed, which is every frame. You could try increasing the frame rate but you're still not going to get it down to 1 pixel differences I wouldn't have thought, the only way to do that might be to interpolate the values you get back so that you get rough idea of what coordinates it passed through between each frame, though that would probably be a bit pointless. What are you trying to do? Piers On 12 Mar 2008, at 14:55, Matt S. wrote: Hi, can anyone recommend a way to have pixel-accurate mouse tracking? If I move my mouse slowly it pretty much grabs them all, but any fast movements result in huge gaps in the _xmouse tracking, so instead of being 1,2,3,4,5,6,7,8,9,10,11,12 etc, it'll be 1,4,6,9,12,15,16,23,30,35, etc. I need it it to be as accurate as possible. Can this be done? .m ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders [EMAIL PROTECTED] 0207 631 3278 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] pixel-accurate _xmouse tracking?
Matt, the mouse move event fired at a set rate so the faster you move it the greater the distance will be until the next event. If you want to sample faster then you'd have to use a setInterval at something really small like 10ms and grab the mouse location like that. Even then you cant guarantee that each event will give you the next pixel. I suggest you change your logic to suit this behaviour. Cheers Matt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Matt S. Sent: 12 March 2008 14:56 To: Flash Coders List Subject: [Flashcoders] pixel-accurate _xmouse tracking? Hi, can anyone recommend a way to have pixel-accurate mouse tracking? If I move my mouse slowly it pretty much grabs them all, but any fast movements result in huge gaps in the _xmouse tracking, so instead of being 1,2,3,4,5,6,7,8,9,10,11,12 etc, it'll be 1,4,6,9,12,15,16,23,30,35, etc. I need it it to be as accurate as possible. Can this be done? .m ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders __ This e-mail has been scanned for viruses by the Virtual Universe e-mail security system - powered by MessageLabs. http://www.virtual-universe.net __ The contents of this email (which include its attachments) are confidential and may be subject to legal privilege and protected by copyright. If you are not the intended recipient any use, copying or disclosure of this e-mail to any third party is strictly forbidden by the sender and we reserve all rights and remedies against any person or entity making any such unauthorised use. If you have received this email in error, please contact the sender immediately by telephone or return the email to the sender and then delete this email and any copies of it on your system. Virtual Universe Limited may monitor the contents of emails sent and received via its network for viruses and to ensure the lawful and authorised use of its systems. Virtual Universe Limited will not be held responsible for any damage caused by viruses which may be transmitted upon receipt of this email or the opening of any attachment thereto. Any views or opinions presented in this email are solely those of th! e author and do not necessarily represent those of Virtual Universe Limited. Virtual Universe Limited is a company established under the laws of England and Wales with registered number 03064568 and has its registered office at 1 Regent Street, London, SW1Y 4NW and principal place of business at 28-39 The Quadrant, 135 Salusbury Road, London NW6 6RJ, United Kingdom. It is registered for VAT in the United Kingdom with number GB877113217. __ This e-mail has been scanned for viruses by the Virtual Universe e-mail security system - powered by MessageLabs. http://www.virtual-universe.net ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders