-- Lingo syntax _movie.constrainV(intSpriteNum,intPosn) // JavaScript syntax _movie.constrainV(intSpriteNum,intPosn);
Movie method; returns an integer whose value depends on the vertical coordinates of the top and bottom sides of a sprite.
The returned integer can be one of three possible values.
intPosn parameter is between the values of the sprite's top and bottom coordinates, the returned integer equals intPosn.
intPosn parameter iis less than the value of the sprite's top coordinate, the returned integer changes to the value of the sprite's top coordinate.
intPosn parameter iis greater than the value of the sprite's bottom coordinate, the returned integer changes to the value of the sprite's bottom coordinate.
This method does not change the sprite's properties.
Both the constrainV() and constrainH()s constrain only one axis each.
intSpriteNum Required. An integer that identifies the sprite whose vertical coordinates are evaluated against intPosn.
intPosn Required. An integer to be evaluated against by the vertical coordinates of the left and right sides of the sprite identified by intSpriteNum.
These statements check the constrainV function for sprite 1 when it has top and bottom coordinates of 40 and 60:
-- Lingo syntax put(constrainV(1, 20)) -- 40 put(constrainV(1, 55)) -- 55 put(constrainV(1, 100)) -- 60 // JavaScript syntax 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:
-- Lingo syntax sprite(1).locV = _movie.constrainV(2, _mouse.mouseH) // JavaScript syntax sprite(1).locV = _movie.constrainV(2, _mouse.mouseH);
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/director/mx2004/release_update_en/07_met59.htm