puppetSprite()
479
puppetSprite()
Usage
-- Lingo syntax
_movie.puppetSprite(
intSpriteNum
,
bool
)
// JavaScript syntax
_movie.puppetSprite(
intSpriteNum
,
bool
);
Description
Movie method; determines whether a sprite channel is a puppet and under script control (
TRUE
)
or not a puppet and under the control of the Score (
FALSE
).
While the playhead is in the same sprite, turning off the sprite channel’s puppetting using the
syntax
puppetSprite(
intSpriteNum
,
FALSE)
resets the sprite’s properties to those in the Score.
The sprite channel’s initial properties are whatever the channel’s settings are when the
puppetSprite()
method is executed. You can use script to change sprite properties as follows:
•
If a sprite channel is a puppet, any changes that script makes to the channel’s sprite properties
remain in effect after the playhead exits the sprite.
•
If a sprite channel is not a puppet, any changes that script makes to a sprite last for the life of
the current sprite only.
The channel must contain a sprite when you use the
puppetSprite()
method.
Making the sprite channel a puppet lets you control many sprite properties—such as
member
,
locH
, and
width
—from script after the playhead exits the sprite.
Use the syntax
puppetSprite(
intSpriteNum
,
FALSE)
to return control to the Score when you
finish controlling a sprite channel from script and to avoid unpredictable results that may occur
when the playhead is in frames that aren’t intended to be puppets.
Note:
Version 6 of Director introduced autopuppetting, which made it unnecessary to explicitly
puppet a sprite under most circumstances. Explicit control is still useful if you want to retain complete
control over a channel’s contents even after a sprite span has finished playing.
Parameters
intSpriteNum
Required. An integer that specifies the sprite channel to test.
bool
Required. A boolean value that specifies whether a sprite channel is under script control
(
TRUE
) or under the control of the Score (
FALSE
).
Example
This statement makes the sprite in channel 15 a puppet:
-- Lingo syntax
_movie.puppetSprite(15, TRUE)
// JavaScript syntax
_movie.puppetSprite(15, true);
Summary of Contents for DIRECTOR MX 2004
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...