Stop a scroller in motion
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 43
- Joined: Tue Apr 08, 2008 9:56 pm
Stop a scroller in motion
I am creating an app that is very similar to the "Contacts" app-- there is a bunch of alphabetic content that the user can scroll through. On the right is the alphabet listed--which allows the user to quickly jump to any part of the scroller (see screen shot). Currently, it works by detecting a movement over the alphabet--then it finds the proper vscroll and sets the vscroll of the scroller. The problem I'm having is that if the user flicks the scroller, then starts using the alphabet thingy, the two "compete" for setting the vscroll. It's a jerky mess. Is there a command that will stop a scroller that is already in motion?
Re: Stop a scroller in motion
Ciuld you perhaps use the 'dragging' property of the scroller to determine if a scroll (drag action) is already taking place and if it is then don't allow another scroll ( drag action) to take place until the first one has finished... Since the 'dragging' property for the scroller is boolean, if should be fairly simple to determine...
-
- Posts: 43
- Joined: Tue Apr 08, 2008 9:56 pm
Re: Stop a scroller in motion
well, there really aren't "two" scroll actions. I'm just trying to terminate a scroll in progress. Imagine a scroller with a large amount of content. You give it a quick flip and watch it fly. It will eventually slow down and come to a stop, but I want to manually stop it. Like press a button and the scroller stops moving (similar to if you were to just put your finger down on it while it was in motion).Dixie wrote:Ciuld you perhaps use the 'dragging' property of the scroller to determine if a scroll (drag action) is already taking place and if it is then don't allow another scroll ( drag action) to take place until the first one has finished... Since the 'dragging' property for the scroller is boolean, if should be fairly simple to determine...
-
- Posts: 43
- Joined: Tue Apr 08, 2008 9:56 pm
Re: Stop a scroller in motion
Still searching for an answer to this. Anybody?
Re: Stop a scroller in motion
This;
Putting false into goodToGo stops it dead.
Sorry only tested on Android.
Simon
Code: Select all
on scrollerDidScroll hOffset, vOffset
if goodToGo then
set the vScroll of group "scrollArea" to vOffset
end if
end scrollerDidScroll
Sorry only tested on Android.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Stop a scroller in motion
I haven't tried it, but see if you can trap either the scrollerEndDecelerate or the scrollerEndDrag message. One of those might tell you when the user stops the scroller.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 43
- Joined: Tue Apr 08, 2008 9:56 pm
Re: Stop a scroller in motion
This works pretty well, in that it stops the content from moving. The downside is that the native scroller still maintains it's momentum regardless. If I set gGoodToGo to false, it stops the content from scrolling. However, if gGoodToGo is set back to true while the nativeScroller is still decelerating, then the content will start moving again. However, this is getting closer to exactly what I want, so thanks!Simon wrote:This;Putting false into goodToGo stops it dead.Code: Select all
on scrollerDidScroll hOffset, vOffset if goodToGo then set the vScroll of group "scrollArea" to vOffset end if end scrollerDidScroll
Sorry only tested on Android.
Simon
Ideally there should be a mobileControlSet "stopmovingyoustupidscroller" to send to the native scroller.
Re: Stop a scroller in motion
Hi Simon,
Just came across your post with the sample stack and tested it on my Android tablet.
When scrolling down it does not go all to the bottom of the text (see the screen shot) - there are still many lines below the bottom edge.
Any idea why?
keram
Just came across your post with the sample stack and tested it on my Android tablet.
When scrolling down it does not go all to the bottom of the text (see the screen shot) - there are still many lines below the bottom edge.
Any idea why?
keram
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit
Re: Stop a scroller in motion
Hi keram,
That field is locked, just unlock it and reset it's height.
Note... The field not the group
Simon
That field is locked, just unlock it and reset it's height.
Note... The field not the group

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!