At 12:53 Uhr -0700 22.10.2002, Buzz Kettles wrote:
At 1:45 PM -0500 10/22/02, you wrote:
I'm having a great deal of trouble getting a dictionary to work
correctly.

Here's the scenario...

Text cast members at the top of the screen representing the alphabet.
User clicks on a letter. A field cast member on the screen then jumps to
the first line whose first character matches the letter they've clicked
on.

I tried a repeat loop that went thru the entire field cast member, but
it takes forever and the end result is that it doesn't scroll to the
line I need.

How does one find the first line in a field that matches the letter the
user has clicked on?

the following handler works for #text and #field members:

on mScrollTo theText, targetMember
if targetMember.text.line[1] starts theText then
targetMember.scrollTop = 0
else
pos = offset(RETURN&theText, targetMember.text)
if pos then targetMember.scrollTop = (targetMember.charPosToLoc(pos)).locV
end if
end


mScrollTo "g", member("textORfield") should then scroll to the first line beginning with "g", if any.

and:
mScrollTo "gu", member("textORfield") should then scroll to the first line beginning with "gu", if any.

and: you can 'reset' it to the first line with:
mScrollTo "", member("textORfield")


--

|||
a�ex
--
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]

Reply via email to