Catching scroller Messages
Posted: Thu Mar 15, 2012 8:00 pm
Hi,
My ultimate goal is to be able to establish if a user "bounces" off either the side margins or top margins of a scroller or browser in IOS. I have an application that loads PDf's maps into a browser. The maps are indexed on a grid system. If the user pans hard to say the right I would like to load the page that exists on the grid to the right. Same for top, bottom and both sides.
I already have the navigation script worked out but need to "catch the message" if there is one to execute the page load
It looks like the scroller returns more messages than the browser which is primarily regarding the status of a page load. So I loaded the browser into a scroller to see what I can do. I inserted the following code into the same card script that the scroller creation handler resides on to investigate but got no response back while scrolling around.
What am I doing wrong and do any of you think what I am trying to do is possible?
on scrollerBeginDecelerate
answer "deacelerating now"
end scrollerBeginDecelerate
##This message is sent when scrolling is about to start decelerating.
on scrollerEndDecelerate
answer "stopped deacelerating"
end scrollerEndDecelerate
##This message is sent when scrolling has finished decelerating.
on scrollerScrollToTop
answer "just scrolled to top"
end scrollerScrollToTop
##This message is sent when the scroller is scrolled to top by touching the status bar.
on scrollerBeginDrag
answer "begining a drag"
end scrollerBeginDrag
##This message is sent when a scroll initiating drag is started.
on scrollerEndDrag didDecelerate
answer "drag is finished"
end scrollerEndDrag
My ultimate goal is to be able to establish if a user "bounces" off either the side margins or top margins of a scroller or browser in IOS. I have an application that loads PDf's maps into a browser. The maps are indexed on a grid system. If the user pans hard to say the right I would like to load the page that exists on the grid to the right. Same for top, bottom and both sides.
I already have the navigation script worked out but need to "catch the message" if there is one to execute the page load
It looks like the scroller returns more messages than the browser which is primarily regarding the status of a page load. So I loaded the browser into a scroller to see what I can do. I inserted the following code into the same card script that the scroller creation handler resides on to investigate but got no response back while scrolling around.
What am I doing wrong and do any of you think what I am trying to do is possible?
on scrollerBeginDecelerate
answer "deacelerating now"
end scrollerBeginDecelerate
##This message is sent when scrolling is about to start decelerating.
on scrollerEndDecelerate
answer "stopped deacelerating"
end scrollerEndDecelerate
##This message is sent when scrolling has finished decelerating.
on scrollerScrollToTop
answer "just scrolled to top"
end scrollerScrollToTop
##This message is sent when the scroller is scrolled to top by touching the status bar.
on scrollerBeginDrag
answer "begining a drag"
end scrollerBeginDrag
##This message is sent when a scroll initiating drag is started.
on scrollerEndDrag didDecelerate
answer "drag is finished"
end scrollerEndDrag