
Lingo Dictionary
153
constrainV()
Syntax
constrainV (
whichSprite
,
integerExpression
)
Description
Function; evaluates
integerExpression
and then returns a value that depends on the vertical
coordinates of the top and bottom edges of the sprite specified by
whichSprite
, as follows:
•
When the value is between the top and bottom coordinates, the value doesn’t change.
•
When the value is less than the top coordinate, the value changes to the value of the top coordinate.
•
When the value is greater than the bottom coordinate, the value changes to the value of the
bottom coordinate.
This function does not change the sprite properties.
Examples
These statements check the
constrainV
function for sprite 1 when it has top and bottom
coordinates of 40 and 60:
put constrainV(1, 20)
-- 40
put constrainV(1, 55)
-- 55
put constrainV(1, 100)
-- 60
This statement constrains a moveable slider (sprite 1) to the edges of a gauge (sprite 2) when the
mouse pointer moves past the edge of the gauge:
set the locV of sprite 1 to constrainV(2, the mouseV)
See also
bottom
,
constraint
,
top
,
constrainH()
contains
Syntax
stringExpression1
contains
stringExpression2
Description
Operator; compares two strings and determines whether
stringExpression1
contains
stringExpression2
(
TRUE
) or not (
FALSE
).
The
contains
comparison operator has a precedence level of 1.
The
contains
comparison operator is useful for checking whether the user types a specific
character or string of characters. You can also use the
contains
operator to search one or more
fields for specific strings of characters.
Содержание DIRECTOR MX-LINGO DICTIONARY
Страница 1: ...Lingo Dictionary Macromedia Director MX...
Страница 756: ...Index 756...