478
Chapter 12: Methods
puppetPalette()
Usage
-- Lingo syntax
_movie.puppetPalette(
palette
{,
speed
} {,
frames
})
// JavaScript syntax
_movie.puppetPalette(
palette
{,
speed
} {,
frames
});
Description
Movie method; causes the palette channel to act as a puppet and lets script override the palette
setting in the palette channel of the Score and assign palettes to the movie.
The
puppetPalette()
method sets the current palette to the palette cast member specified by
palette
. If
palette
evaluates to a string, it specifies the cast library name of the palette. If
palette
evaluates to an integer, it specifies the member number of the palette.
For best results, use the
puppetPalette()
method before navigating to the frame on which the
effect will occur so that Director can map to the desired palette before drawing the next frame.
You can fade in the palette by replacing
speed
with an integer from 1 (slowest) to 60 (fastest). You
can also fade in the palette over several frames by replacing
frames
with an integer for the
number of frames.
A puppet palette remains in effect until you turn it off using the syntax
_movie.puppetPalette(0)
. No subsequent palette changes in the Score are obeyed when the
puppet palette is in effect.
Note:
The browser controls the palette for the entire Web page. Thus, Shockwave Player always
uses the browser’s palette.
Parameters
palette
Required. A string or integer that specifies the name or number of the new palette.
speed
Optional. An integer that specifies the speed of a fade. Valid values range from 1 to 60.
frames
Optional. An integer that specifies the number of frames over which a fade takes place.
Example
This statement makes Rainbow the movie’s palette:
-- Lingo syntax
_movie.puppetPalette("Rainbow")
// JavaScript syntax
_movie.puppetPalette("Rainbow");
The following statement makes Grayscale the movie’s palette. The transition to the Grayscale
palette occurs over a time setting of 15, and over 20 frames.
-- Lingo syntax
_movie.puppetPalette("Rainbow", 15, 20)
// JavaScript syntax
_movie.puppetPalette("Rainbow", 15, 20);
See also
Movie
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...