mouse tracking blues
Scott Rossi
scott at tactilemedia.com
Tue Jul 9 16:50:01 EDT 2002
Recently, "jbv" wrote:
> I'm facing a problem for which using
> a repeat loop inside a mousedown seems to be the
> only solution, and of course I met the problem of
> the mouseup event not being trapped by my script.
>... I can't use mousemove, since the image must
> keep scrolling even when the mouse isn't moving, as long
> as it is down.
Are you sure you can't use mouseMove? It sounds to me like you could try
using "send in" instead of "repeat", like this (untested):
on mouseDown
set the uAllowScroll of this stack to true
doScroll
end mouseDown
on mouseMove x,y
if not the uAllowScroll of this stack then exit mouseMove
set the uMLoc of this stack to x & "," & y
end mouseMove
on doScroll
if not the uAllowScroll of this stack then exit doScroll
put item 1 of the uMLoc of this stack into x
show img 1 at max(-633,min(1432,x - (trunc((x-400)/10)))),300
send "doScroll" to me in 2 milliseconds
end doScroll
on mouseUp
set the uAllowScroll of this stack to false
end mouseUp
on mouseRelease
mouseUp
end mouseRelease
Technically you don't really need to toggle the mouseMove detection since
you're not relying on it to scroll your object, but perhaps doing so
eliminates unnecessary events.
Maybe this will work for you...
Regards,
Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
-----
E: scott at tactilemedia.com
W: http://www.tactilemedia.com
More information about the metacard
mailing list