More send in time

Ken Norris pixelbird at interisland.net
Thu Jul 3 01:51:01 EDT 2003


> From: Cubist at aol.com
> Date: Tue, 1 Jul 2003 14:20:03 EDT
> Subject: Re: More send in time

> if within(graphic "upScrollArea", mouseLoc()) then
> 
> set the vScroll of fld 1 to (1 + ((the vScroll of fld 1) + 1343) mod 1345)
> 
> else if within(graphic "downScrollArea", mouseLoc()) then
> 
> set the vScroll of fld 1 to (1 + ((the vScroll of fld 1) + 1345) mod 1345)
> 
> end if
-----------
So what's wrong with this?:

on endlessScroller
   constant scrollSpeedInterval = 10
   if not the uAllowScroll of me then exit endlessScroller
     if within(graphic "upScrollArea", mouseLoc()) then

    set the vScroll of fld 1 to ((the vScroll of fld 1) + 1344) mod 1345
## Causes a negative 1, so it starts immediately and
## continues in that direction.

  else if within(graphic "downScrollArea", mouseLoc()) then

    set the vScroll of fld 1 to ((the vScroll of fld 1) + 1345) mod 1344
## Causes a positive 1 and continues in that direction

  end if
   send "endlessScroller" to me in scrollSpeedInterval milliseconds
end endlessScroller

...That thing works flawlessly in my setting.
-----------
> As long as this bit of code is *only* activated when the mouse is within
> one of your two "xxxScrollArea"s, it should work fine. Hmmm... try this on for
> size:
> 
> # in card script
> on ScrollControl
> if within(graphic "upScrollArea", mouseLoc()) then
> ScrollDatPuppy (-2)
> else if within(graphic "downScrollArea", mouseLoc()) then
> ScrollDatPuppy (0)
> send "ScrollControl" to me in 10 milliseconds -- adjust to taste
> end ScrollControl
> 
> on ScrollDatPuppy Direx
> set the vScroll of fld 1 to (1 + ((the vScroll of fld 1) + 1345 + Direx)
> mod 1345)
> end ScrollDatPuppy
-----------
I tried this, but it scrolls just one pixel, then quits. I haven't figured
out why yet.

Ken N.






More information about the use-livecode mailing list