1 (edited by posniewski 2008-01-20 11:01:12)

Topic: Touchscreen update rate

I wrote a quickie drawing widget and found that the update rate for _xmouse and _ymouse are pretty slow. Slow enough that the sample points when drawing are quite far apart (and hence angular). I'm guessing it's updated at 12fps (movie rate)? Is there any way to get updates more often, or perhaps a way to get a list of points which were sampled by the device since the last update?

No matter what, I'd probably need to smooth the drawing some, but I was hoping to get more data points to start with.

(Edited to make more clear what the problem was.)

Re: Touchscreen update rate

In general Flash's update rate for mouse position "feels" slow.

One solution I used recently used two separate clips (for two independent drawings) and curve to to "fake" a smoother feel. Essentially it worked like this (tempDrawClip and drawClip are the two clips):

onMouseDown:
moveTo the x, y on the drawClip and tempDrawClip
record the x, y into a list of points

onMouseMove:
clear the tempDrawClip
lineStyle the tempDrawClip
lineTo the x,y on the tempDrawClip
add the x, y to the point list
if the list of points > 3
    find the midpoint between the x, y and the previous point in the point list
    curveTo that midpoint using the previous point in the point list as the control point in the drawClip
else
    find the midpoint between x, y and the previous point in the point list
    lineTo that midpoint in the drawClip


onMouseUp:
clear the tempDrawClip
lineTo the x, y in the drawClip