Hi there,
I want to have scrolling buttons over a card for a mobile application. With referring to Native Scroller lesson, I created a group of buttons "button".
Now, what variation of below script needs to be put on the parent card so I can have scrolling button??
local sScrollerID
on preOpenCard
local tScrollerRect, tContentRect
// Only create a scroller on a mobile device
if environment() is not "mobile" then exit preOpenCard
// Set the area of the scroller
put the rect of group "button" into tScrollerRect
// Set the are of the content to be scrolled
put the left of field "lorem",the top of field "lorem",the right of field "lorem",the formattedHeight of field "lorem" into tContentRect
// Create the scroller control
mobileControlCreate "scroller", "loremScroll"
put the result into sScrollerID
// Set the properties of the scroller
mobileControlSet "loremScroll", "rect", tScrollerRect
mobileControlSet "loremScroll", "contentRect", tContentRect
mobileControlSet "loremScroll", "visible", true
mobileControlSet "loremScroll", "scrollingEnabled", true
mobileControlSet "loremScroll", "vIndicator", true
mobileControlSet "loremScroll", "vscroll", 0
end preOpenCard
on scrollerDidScroll hOffset, vOffset
// When the user scrolls move the displayed content
set the vScroll of group "scrollArea" to vOffset
end scrollerDidScroll
Please help.
Mobile- button scroll
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Mobile- button scroll
Last edited by saviour on Thu Nov 12, 2015 2:33 am, edited 1 time in total.
Re: Mobile- button scroll
Hi..
Have a look at the attached stack... it allows you to create buttons in a group 'setgroup' that will scroll. All the handlers are in the stack script.
Hope it helps...
Have a look at the attached stack... it allows you to create buttons in a group 'setgroup' that will scroll. All the handlers are in the stack script.
Hope it helps...
- Attachments
-
- scrollButtons.livecode.zip
- (2.66 KiB) Downloaded 176 times
Re: Mobile- button scroll
Thanks... I will try it out!!!