User Guide
376 Chapter 12: Methods
isPastCuePoint()
Usage
-- Lingo syntax
spriteObjRef.isPastCuePoint(cuePointID)
// JavaScript syntax
spriteObjRef.isPastCuePoint(cuePointID);
Description
Function; determines whether a sprite or sound channel has passed a specified cue point in its
media. This function can be used with sound (WAV, AIFF, SND, SWA, AU), QuickTime, or
Xtra files that support cue points.
Replace
spriteNum or channelNum with a sprite channel or a sound channel. Shockwave Audio
(SWA) sounds can appear as sprites in sprite channels, but they play sound in a sound channel. It
is recommended that you refer to SWA sound sprites by their sprite channel number rather than
their sound channel number.
Replace
cuePointID with a reference for a cue point:
• If cuePointID is an integer, isPastCuePoint returns 1 if the cue point has been passed and 0
if it hasn’t been passed.
• If cuePointID is a name, isPastCuePoint returns the number of cue points passed that have
that name.
If the value specified for
cuePointID doesn’t exist in the sprite or sound, the function returns 0.
The number returned by
isPastCuePoint is based on the absolute position of the sprite in its
media. For example, if a sound passes cue point Main and then loops and passes Main again,
isPastCuePoint returns 1 instead of 2.
When the result of
isPastCuePoint is treated as a Boolean operator, the function returns TRUE if
any cue points identified by
cuePointID have passed and FALSE if no cue points are passed.
Parameters
cuePointID
Required. A string or integer that specifies the name or number of the specified
cue point.
Example
This statement plays a sound until the third time the cue point Chorus End is passed:
-- Lingo syntax
if (sound(1).isPastCuePoint("Chorus End")=3) then
sound(1).stop()
end if
// JavaScript syntax
var ce = sound(1).isPastCuePoint("Chorus End");
if (ce = 3) {
sound(1).stop();
}