
386
Chapter 12: Methods
Description
Function; returns a number that identifies which character in a specified field cast member is
closest to a point within the field.
The value 1 corresponds to the first character in the string, the value 2 corresponds to the second
character in the string, and so on.
Parameters
location
Required. A point within the field cast member. The value for
location
is a point
relative to the upper left corner of the field cast member.
Example
The following statement determines which character is closest to the point 100 pixels to the right
and 100 pixels below the upper left corner of the field cast member Today’s News. The statement
then assigns the result to the variable
PageDesign
.
--Lingo syntax
pageDesign = member("Today's News").locToCharPos(point(100, 100))
// JavaScript syntax
var pageDesign = member("Today's News").locToCharPos(point(100, 100));
locVToLinePos()
Usage
-- Lingo syntax
memberObjRef
.locVToLinePos(
locV
)
// JavaScript syntax
memberObjRef
.locVToLinePos(
locV
);
Description
Function; returns the number of the line of characters that appears at a specified vertical position.
Parameters
locV
Required. Specifies the vertical position of the line of characters. This value is the number of
pixels from the top of the field cast member, not the part of the field cast member that currently
appears on the Stage.
Example
This statement determines which line of characters appears 150 pixels from the top of the field
cast member Today’s News and assigns the result to the variable
pageBreak
:
--Lingo syntax
pageBreak = member("Today's News").locVToLinePos(150)
// JavaScript syntax
var pageBreak = member("Today's News").locVToLinePos(150);
Содержание DIRECTOR MX 2004-DIRECTOR SCRIPTING
Страница 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Страница 48: ...48 Chapter 2 Director Scripting Essentials...
Страница 100: ...100 Chapter 4 Debugging Scripts in Director...
Страница 118: ...118 Chapter 5 Director Core Objects...
Страница 594: ...594 Chapter 12 Methods...
Страница 684: ...684 Chapter 14 Properties See also DVD...
Страница 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Страница 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Страница 889: ...netPresent 889 _player alert Sorry the Network Support Xtras could not be found See also Player...
Страница 1102: ...1102 Chapter 14 Properties...