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 sprite’s 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 sprite’s 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 movie’s 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 movie’s 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.
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...