All I am trying to do is touch scroll the text vertically. I have almost got it working but each time you press the screen it jumps to the original start position instead of the finished position. Effectively not scrolling all the way.
Below is a code snippet taken from a lesson.
Code: Select all
local sScrolling
local sInitialMouseX, sInitialMouseY
local sInitialHScroll, sInitialVScroll
on mouseDown
## Allow the group to scroll
put true into sScrolling
## Record the initial touch position
put item 1 of the mouseLoc into sInitialMouseX
put item 2 of the mouseLoc into sInitialMouseY
## Record the initial hScroll and vScroll
put the vScroll of me into sInitialVScroll
put the hScroll of me into sInitialHScroll
end mouseDown
on mouseMove mouseX, mouseY
## If the screen is being touched then
if sScrolling then
## Calculate how far the touch has moved since it started
put mouseY - sInitialMouseY into tVChange
put mouseX- sInitialMouseX into tHChange
## Reset the hScroll and vScroll to follow the touch
lock screen
set the vScroll of me to sInitialVScroll - tVChange
set the hScroll of me to sInitialHScroll - tHChange
unlock screen
end if
end mouseMove
on mouseRelease
mouseUp
end mouseRelease
on mouseUp
put false into sScrolling
end mouseUp
This is again one of those fundamental features needed for mobile deployment. You need to be able to scroll vertically using touch.
Hope someone can help.