Controlling Scrolling Text With Lingo Or Javascript Syntax; Checking For Specific Text With Lingo Or Javascript Syntax - MACROMEDIA DIRECTOR MX 2004-USING DIRECTOR Use Manual

Hide thumbs Also See for DIRECTOR MX 2004-USING DIRECTOR:
Table of Contents

Advertisement

Controlling scrolling text with Lingo or JavaScript syntax

You can script in Lingo or JavaScript syntax to 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
value for the text cast member called Discussion to 0, which makes its first line appear
scrollTop
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 about the following methods and properties, see the Scripting Reference topics
in the Director Help Panel.
To scroll up or down by a specific number of pages in a text or field cast member, use the
scrollByPage
To scroll up or down by a specific number of lines in a text or field cast member, use the
scrollByLine
To determine the number of lines that appear in a field cast member on the Stage, set the
cast member property. (This property doesn't apply to text cast members.)
lineCount
To determine a line's distance from the top edge of a field cast member, use the
linePosToLocV()
To determine the number of the line that appears at a specific vertical position in a field cast
member, use the
cast member, not what appears on the Stage.)
To determine the point in a field cast member that is closest to a specific character, use the
charPosToLoc()
To determine the character that is closest to a specific point in a field cast member, use the
locToCharPos()
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 cast member, test or set the

Checking for specific text with Lingo or JavaScript syntax

The script operators
operator compares two strings to see whether one string contains the other. The equals
contains
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. For
more information, see the Scripting Reference topics in the Director Help Panel
You can also use script to evaluate strings returned by the
member. For more information about this property, see the Scripting Reference topics in the
Director Help Panel.
method.
method.
method.
method. (This measures the distance from the top of the
locVToLinePos()
method.
method.
and the equals symbol (
contains
Checking for specific text with Lingo or JavaScript syntax
cast member property.
scrollTop
) are useful for checking strings. The
=
property of a text or field cast
text
179

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DIRECTOR MX 2004-USING DIRECTOR and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Director mx 2004

Table of Contents