Represents an occurrence of a cast member in a sprite channel of 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.
A sprite can be referenced either by number or by name.
You can create a reference to a Sprite object by using the top level sprite() function, the Movie object's sprite property, or the Sprite Channel object's sprite property.
sprite() function.
-- Lingo syntax objSprite = sprite(1) // JavaScript syntax var objSprite = sprite(1);
sprite property.
-- Lingo syntax objSprite = _movie.sprite["willowTree"] // JavaScript syntax var objSprite = _movie.sprite["willowTree"];
sprite property.
-- Lingo syntax objSprite = channel(3).sprite // JavaScript syntax var objSprite = channel(3).sprite;
You can use a reference to a Sprite object to access the cast member from which the sprite was created. Any changes made to the cast member from which a sprite was created are also reflected in the sprite. The following example illustrates changing the text of a text cast member from which sprite 5 was created. This change to the cast member will also be reflected in sprite 5.
-- Lingo syntax labelText = sprite(5) labelText.member.text = "Weeping Willow" // JavaScript syntax var labelText = sprite(5); labelText.member.text = "Weeping Willow";
Cast Library, Member, Movie, Player, sprite (Movie), sprite (Sprite Channel), sprite(), Sprite Channel, Window