User Guide

translation 1059
translation
Usage
-- Lingo syntax
memberOrSpriteObjRef.translation
// JavaScript syntax
memberOrSpriteObjRef.translation;
Description
QuickTime cast member and sprite property; controls the offset of a QuickTime sprites image
within the sprites bounding box.
This offset is expressed in relation to the sprites default location as set by its
center
property. When
center is set to TRUE, the sprite is offset relative to the center of the bounding
rectangle; when
center is set to FALSE, the sprite is offset relative to the upper left corner of the
bounding rectangle.
The offset, specified in pixels as positive or negative integers, is set as a Director list: [
xTrans,
yTrans]. The xTrans parameter specifies the horizontal offset from the sprites default location;
the
yTrans parameter specifies the vertical offset. The default setting is [0,0].
When the sprite’s
crop property is set to TRUE, the translation property can be used to mask
portions of the QuickTime movie by moving them outside the bounding rectangle. When the
crop property is set to FALSE, the translation property is ignored, and the sprite is always
positioned at the upper left corner of the sprites rectangle.
This property can be tested and set.
Example
The following frame script assumes that the center property of the cast member of a 320-pixel-
wide QuickTime sprite in channel 5 is set to
FALSE, and its crop property is set to TRUE. It keeps
the playhead in the current frame until the movie's horizontal translation point has moved to the
right edge of the sprite, in 10-pixel increments. This has a wipe right effect, moving the sprite out
of view to the right. When the sprite is out of view, the playhead continues to the next frame.
-- Lingo syntax
on exitFrame
horizontalPosition = sprite(5).translation[1]
if horizontalPosition < 320 then
sprite(5).translation = sprite(5).translation + [10, 0]
_movie.go(_movie.frame)
end if
end
// JavaScript syntax
function exitFrame() {
var horizontalPosition = sprite(5).translation[1];
if (horizontalPosition < 320 ) {
sprite(5).translation = sprite(5).translation + list(10, 0);
_movie.go(_movie.frame);
}
}