112
Chapter 5: Director Core Objects
See also
channel() (Sound)
,
sound (Player)
,
sound()
,
Sound
Sprite
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.
•
When referring to a sprite by number, Director searches all sprites that exist in the current
frame of the Score, starting from the lowest numbered channel, and retrieves the sprite’s data
when it finds the numbered sprite. This method is faster than referring to a sprite by name.
However, because Director does not automatically update references to sprite numbers in
script, a numbered reference to a sprite that has moved position on the Stage will be broken.
•
When referring to a sprite by name, Director searches all sprites that exist in the current frame
of the Score, starting from the lowest numbered channel, and retrieves the sprite’s data when it
finds the named sprite. This method is slower than referring to a sprite by number, especially
when referring to large movies that contain many cast libraries, cast members, and sprites.
However, a named reference to a sprite allows the reference to remain intact even if the sprite
moves position on the Stage.
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.
•
Use the top level
sprite()
function.
-- Lingo syntax
objSprite = sprite(1)
// JavaScript syntax
var objSprite = sprite(1);
•
Use the Movie object’s
sprite
property.
-- Lingo syntax
objSprite = _movie.sprite["willowTree"]
// JavaScript syntax
var objSprite = _movie.sprite["willowTree"];
•
Use the Sprite Channel object’s
sprite
property.
-- Lingo syntax
objSprite = channel(3).sprite
// JavaScript syntax
var objSprite = channel(3).sprite;
loopCount
sampleRate
loopEndTime
startTime
loopsRemaining
status
loopStartTime
volume (Sound Channel)
Property (continued)
Summary of Contents for DIRECTOR MX 2004
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...