Lingo Dictionary > A-C > charPosToLoc() |  |

charPosToLoc()

Syntax

    member(whichCastMember).charPosToLoc(nthCharacter)
    charPosToLoc(member whichCastMember, nthCharacter)

Description

Field function; returns the point in the entire field cast member (not just the part that appears on the Stage) that is closest to the character specified by `nthCharacter`. This is useful for determining the location of individual characters.

Values for `charPosToLoc` are in pixels from the top left corner of the field cast member. The `nthCharacter` parameter is 1 for the first character in the field, 2 for the second character, and so on.

Example

The following statement determines the point where the fiftieth character in the field cast member Headline appears and assigns the result to the variable location:

    location = charPosToLoc(member "Headline", 50)