Hi Matthew,
this works, see my comments:
Code: Select all
on preOpenCard
   if environment() is not "mobile" then 
      exit preOpenCard
   end if
   
   put the rect of group "group" into tScrollerRect
   ##put the left of group "group",the top of button "button1",the right of 
   ## TYPO: ...the right of FIELD "group"!!!???
   
   ## But the content rect is the "scrollable area" and not the current rect of that group:
   put 0 & "," & 0 & "," & the width of grp "group" & "," & the formattedheight of group "group" into tContentRect
   mobileControlCreate "scroller", "GroupScroll"
   put the result into sScrollerID
   mobileControlSet "GroupScroll", "rect", tScrollerRect
   mobileControlSet "GroupScroll", "contentRect", tContentRect
   mobileControlSet "GroupScroll", "visible", true
   mobileControlSet "GroupScroll", "scrollingEnabled", true
   mobileControlSet "GroupScroll", "vIndicator", true
   mobileControlSet "GroupScroll", "vscroll", 0
end preOpenCard
on scrollerDidScroll hOffset, vOffset
// When the user scrolls move the displayed content
set the vScroll of group "group" to vOffset
end scrollerDidScroll
Best
Klaus