von dp am 06.Maerz 97 um 01:46:34:
zu: kleine tricks paint, sound von dp am 06.Maerz 97 um 01:26:59:
> Use the height of member prop to get the height of all of the text and
> subtract the pageheight from it. This will give you a maximum value for
> the scrollTop. You might need to add an extra lineHeight depending on
> whether the descenders are clipped off or not.
>
Thank you Andrew White! I had overlooked 'the height of member' property.
No need for any padding either, at least with the point sizes I am using.
Here is the code if any one is interested- simple + generic:
--===scrolling #richtext members --Roy Pardi --sprite scripts on mouseDown ---movie script Roy Pardi
--set the Framing of the #richtext member to 'cropped'
--pass member ref, direction + speed in the button scripts
on mouseDown
scrollRichtext 1, #up, 5
end
scrollRichtext 1, #dn, 5
end
on scrollRichtext theMember, theDirection, speed
set MyHeight = the height of member theMember
Set MyPage = the pageheight of member theMember
set MySP = the clickon
set the loc of sprite MySp = the loc of sprite MySp + 2
updatestage
repeat while the mousedown
set MyTop = the scrolltop of member theMember
case (theDirection) of
#up:
case MyTop <= 0 of
FALSE:set the scrolltop of member theMember = MyTop - speed
end case
#dn:
case MyHeight - (MyTop + MyPage) <= 0 of
FALSE:set the scrolltop of member theMember = MyTop + speed
end case
end case
end repeat
set the loc of sprite MySp = the loc of sprite MySp - 2
updatestage
end
D. Plänitz