Chapter 10
290
Controlling scrolling text with Lingo
Lingo can scroll text and determine the location of specific text within the text box for text and
field cast members. For example, this statement sets the
scrollTop
value for the text cast
member called Discussion to 0, which makes its first line appear at the top of its scrolling field:
(member "Discussion").scrollTop = 0
This procedure can be useful for making a scrolling field automatically scroll back to the top. For
more information on the following properties, see individual entries in the Lingo Dictionary.
•
To scroll up or down by a specific number of pages in a text or field cast member, use the
scrollByPage
command.
•
To scroll up or down by a specific number of lines in a text or field cast member, use the
scrollByLine
command.
•
To determine the number of lines that appear in a field cast member on the Stage, set the
lineCount
cast member property. (This property doesn’t apply to text cast members.)
•
To determine a line’s distance from the top edge of a text or field cast member, use the
linePosToLocV()
function.
•
To determine the number of the line that appears at a specific vertical position in a text or field
cast member, use the
locVToLinePos()
function. (This measures the distance from the top of
the cast member, not what appears on the Stage.)
•
To determine the point in a text or field cast member that is closest to a specific character, use
the
charPosToLoc()
function.
•
To determine the character that is closest to a specific point in a text or field cast member, use
the
locToCharPos()
function.
•
To check or set the distance from the top of the line that is currently visible to the top of the
box for a scrolling field or text cast member, test or set the
scrollTop
cast member property.
Checking for specific text with Lingo
The Lingo operators
contains
and the equals symbol (
=
) are useful for checking strings. The
contains
operator compares two strings to see whether one string contains the other. The equals
symbol operator can determine whether a string is exactly the same as the contents of a field cast
member. Use these operators to check whether a specified string is in a field cast member. See
contains
in the Lingo Dictionary.
You can also use Lingo to evaluate strings returned by the
text
property of a text or field cast
member. See
text
in the Lingo Dictionary.
Содержание DIRECTOR MX-USING DIRECTOR MX
Страница 1: ...Using Director MX Macromedia Director MX...
Страница 12: ...Contents 12...
Страница 156: ...Chapter 4 156...
Страница 202: ...Chapter 6 202...
Страница 244: ...Chapter 7 244...
Страница 292: ...Chapter 10 292...
Страница 330: ...Chapter 12 330...
Страница 356: ...Chapter 13 356...
Страница 372: ...Chapter 14 372...
Страница 442: ...Chapter 16 442...
Страница 472: ...Chapter 18 472...
Страница 520: ...Chapter 19 520...
Страница 536: ...Chapter 20 536...
Страница 562: ...Chapter 23 562...
Страница 566: ...Chapter 24 566...
Страница 602: ...Chapter 27 602...