Getting vScroll movement of a field scrollbar

Kay C Lan lan.kc.macmail at gmail.com
Tue Dec 11 04:00:00 EST 2007


On Dec 11, 2007 11:12 AM, James Hurley <jhurley0305 at sbcglobal.net> wrote:

> >
> > On Dec 11, 2007 7:05 AM, James Hurley <jhurley0305 at
>
>  Good thought, but it doesn't work unless the mouse leaves and
> reenters the field.


Yes, but that shouldn't be a problem. I figured you'd do something like
this:

on scrollbarDrag tNewPosition
 --do fancy stuff
 put tNewPosition into tStart
end scrollDrag

That way, tStart is always being updated with the last position of the drag.

There are probably other times you want to initialize tStart, like on
openCard or openStack handlers, but as a last resort, the most up to date
would be an 'one mouseEnter' handler. Once inside the field the 'on
scrollbarDrag' message should keep track of every movement so all you need
to do is update tStart after every move.

HTH



More information about the use-livecode mailing list