Sprite Channel
Represents an individual sprite channel in the Score.
A Sprite object covers a sprite span, which is a range of frames in a given sprite channel. A Sprite
Channel object represents an entire sprite channel, regardless of the number of sprites it contains.
Sprite channels are controlled by the Score by default. Use the Sprite Channel object to switch
control of a sprite channel over to script during a Score recording session.
A sprite channel can be referenced either by number or by name.
•
When referring to a sprite channel by number, you access the channel directly. This method is
faster than referring to a sprite channel by name. However, because Director does not
automatically update references to sprite channel numbers in script, a numbered reference to a
sprite channel that has moved position in the Score will be broken.
•
When referring to a sprite channel by name, Director searches all channels, starting from the
lowest numbered channel, and retrieves the sprite channel's data when it finds the named sprite
channel. This method is slower than referring to a sprite channel by number, especially when
referring to large movies that contain many cast libraries, cast members, and sprites. However,
a named reference to a sprite channel allows the reference to remain intact even if the sprite
channel moves position in the Score.
You can create a reference to a Sprite Channel object by using the top level
and referring to either the channel number or name.
-- Lingo syntax
objSpriteChannel = channel(2) -- numbered reference
objSpriteChannel = channel("background") -- named reference
// JavaScript syntax
var objSpriteChannel = channel(2); // numbered reference
var objSpriteChannel = channel("background"); // named reference
You can use a reference to a Sprite Channel object to access the sprite that is currently being used
in a particular sprite channel. The following example illustrates accessing the background color of
the sprite that is currently being used in sprite channel 2.
-- Lingo syntax
labelSprite = channel(2).sprite.backColor
// JavaScript syntax
var labelSprite = channel(2).sprite.backColor;
Method summary for the Sprite Channel object
Method
makeScriptedSprite()
removeScriptedSprite()
114
Chapter 5: Director Core Objects
method,
channel()
Need help?
Do you have a question about the DIRECTOR MX 2004-DIRECTOR SCRIPTING and is the answer not in the manual?
Questions and answers