Vscroll Property of a field that is scrolled to the end
Sivakatirswami
katir at hindu.org
Sun Jul 6 15:58:10 EDT 2008
How do you get the vscroll of a field that would be scrolled all the way
to the end, without actually scrolling it to the end?
What I want to do is the "rolling credits" thing.
This works
CASE "About"
put 1 into tAboutScroll
REPEAT until the vscroll of fld "About" = 2714
# the 2714 here is hard coded value...
# I want to get it as a property regardless of what the field contains
or it's size, font etc.
set the vscroll of fld "About" to tAboutScroll
put tAboutScroll +1 into tAboutScroll
IF the mouseclick THEN exit repeat
wait 1 ticks
END repeat
break
But you have to customize that for every field... the 2714 is hard
coded. I'm trying to get generic script that I can toss around from one
stack to another and they still work...
put the formattedheight of fld "song"-the height of fld "song"- the
vscroll of fld "song"
always returns 6... so one can calculate the ending vscroll value from
this, if I have the field scrolled to the very end. Is this a
"solid" algorithm:
on scrollsong
put 1 into tSongScroll
put (the formattedheight of fld "song"-the height of fld "song"- 5)
into tEnd
REPEAT until the vscroll of fld "Song" = tEnd
set the vscroll of fld "song" to tSongScroll
put tSongScroll +1 into tSongScroll
IF the mouseclick THEN exit repeat
wait 5 milliseconds
END repeat
end scrollsong
it feels like a bit of a hack....when I could be use some actual property.
skts
More information about the use-livecode
mailing list