
Chapter 3
168
currentSpriteNum
Syntax
the currentSpriteNum
Description
Movie property; indicates the channel number of the sprite whose script is currently running. It
is valid in behaviors and cast member scripts. When used in frame scripts or movie scripts, the
currentSpriteNum
property’s value is 0.
The
currentSpriteNum
property is similar to
spriteNum of me
, but it doesn’t require the
me
reference.
This property can be tested but not set.
Note:
This property was more useful during transitions from older movies to Director 6, when behaviors were
introduced. It allowed some behavior-like functionality without having to completely rewrite Lingo code. It is not
necessary when authoring with behaviors and is therefore less useful than in the past.
Example
The following handler in a cast member or movie script switches the cast member assigned to the
sprite involved in the
mouseDown
event:
on mouseDown
sprite(the currentSpriteNum).member = member "DownPict"
end
See also
me
,
spriteNum
currentTime
Syntax
sprite(
whichSprite
).currentTime
the currentTime of sprite
whichSprite
sound(
channelNum
).currentTime
Description
Sprite and sound channel property; returns the current playing time, in milliseconds, for a sound
sprite, QuickTime digital video sprite, or any Xtra that supports cue points. For a sound channel,
returns the current playing time of the sound member currently playing in the given sound channel.
This property can be tested, but can only be set for traditional sound cast members (WAV, AIFF,
SND). When this property is set, the range of allowable values is from zero to the
duration
of
the member.
Shockwave Audio (SWA) sounds can appear as sprites in sprite channels, but they play sound in a
sound channel. You should refer to SWA sound sprites by their sprite channel number rather than
by a sound channel number.
Example
This statement displays the current time, in seconds, of the sound sprite in sprite channel 10.
Dot syntax:
member("time").text = string(sprite (10).currentTime/ 1000)
Summary of Contents for DIRECTOR MX-LINGO DICTIONARY
Page 1: ...Lingo Dictionary Macromedia Director MX...
Page 756: ...Index 756...