You are on page 1of 2

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
channel() method, 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()

Property summary for the Sprite Channel object


Property
name (Sprite Channel)
number (Sprite Channel)
scripted
sprite (Sprite Channel)

See also

Cast Library, channel() (Top level), Member, Movie, Player, Sprite,


Window

You might also like