User Guide

1082 Chapter 14: Properties
Example
This handler accepts a sprite reference as a parameter and moves the view of a Flash movie sprite
from left to right within the sprites bounding rectangle:
-- Lingo syntax
on panRight whichSprite
repeat with i = 120 down to -120
sprite(whichSprite).viewH = i
_movie.updateStage()
end repeat
end
// JavaScript syntax
function panRight(whichSprite) {
var i = 120;
while(i > -121) {
sprite(whichSprite).viewH = i;
_movie.updateStage();
i--;
}
}
See also
scaleMode, viewV, viewPoint, viewScale
viewPoint
Usage
-- Lingo syntax
memberOrSpriteObjRef.viewPoint
// JavaScript syntax
memberOrSpriteObjRef.viewPoint;
Description
Cast member property and sprite property; controls the point within a Flash movie or vector
shape that is displayed at the center of the sprites bounding rectangle in pixel units. The values
are integers.
Changing the view point of a cast member changes only the view of a movie in the sprite’s
bounding rectangle, not the location of the sprite on the Stage. The view point is the coordinate
within a cast member that is displayed at the center of the sprite’s bounding rectangle and is
always expressed relative to the movies origin (as set by the
originPoint, originH, and originV
properties). For example, if you set a Flash movie’s view point at point (100,100), the center of
the sprite is the point within the Flash movie that is 100 Flash movie pixel units to the right
and 100 Flash movie pixel units down from the origin point, regardless of where you move the
origin point.
The
viewPoint property is specified as a Director point value: for example, point (100,200).
Setting a Flash movies view point with the viewPoint property is the same as setting the viewH
and
viewV properties separately. For example, setting the viewPoint property to point (50,75) is
the same as setting the
viewH property to 50 and the viewV property to 75.