Mobile- button scroll
Posted: Fri Feb 21, 2014 12:43 pm
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.
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.