scale (Member)
969
scale (Member)
Usage
-- Lingo syntax
memberOrSpriteObjRef
.scale
// JavaScript syntax
memberOrSpriteObjRef
.scale;
Description
Cast member property and sprite property; controls the scaling of a QuickTime, vector shape, or
Flash movie sprite.
For QuickTime, this property does not scale the sprite’s bounding rectangle or the sprite’s
controller. Instead, it scales the image around the image’s center point within the bounding
rectangle. The scaling is specified as a Director list containing two percentages stored as float-
point values:
[
xPercent
,
yPercent
]
The
xPercent
parameter specifies the amount of horizontal scaling; the
yPercent
parameter
specifies vertical scaling.
When the sprite’s
crop
property is set to
TRUE
, the
scale
property can be used to simulate
zooming within the sprite’s bounding rectangle. When the sprite’s
crop
property is set to
FALSE
,
the
scale
property is ignored.
This property can be tested and set. The default value is [1.0000,1.0000].
For Flash movie or vector shape cast members, the scale is a floating-point value. The movie is
scaled from its origin point, as specified by its
originMode
property.
Note:
This property must be set to the default value if the scaleMode property is set to #autoSize;
otherwise the sprite does not display correctly.
Example
This handler accepts a reference to a Flash movie sprite as a parameter, reduces the movie’s
scale to 0% (so it disappears), and then scales it up again in 5% increments until it is full size
(100%) again:
-- Lingo syntax
on scaleMovie whichSprite
sprite(whichSprite).scale = 0
_movie.updatestage()
repeat with i = 1 to 20
sprite(whichSprite).scale = i * 5
_movie.updatestage()
end repeat
end
// JavaScript syntax
function scaleMovie(whichSprite) {
sprite(whichSprite).scale = 0;
_movie.updatestage();
var i = 1;
while (i < 21) {
sprite(whichSprite).scale = i * 5;
_movie.updatestage();
i++;
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...