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.
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 |
|---|
makeScriptedSprite() |
removeScriptedSprite() |
| Property |
|---|
name (Sprite Channel) |
number (Sprite Channel) |
scripted |
sprite (Sprite Channel) |
Cast Library, channel() (Top level), Member, Movie, Player, Sprite, Window