Lingo Dictionary > G-K > isPastCuePoint() |  |

isPastCuePoint()

Syntax

    sprite(spriteNum).isPastCuePoint(cuePointID)
    isPastCuePoint(sprite(spriteNum), cuePointID)
    sound(channelNum).isPastCuePoint(cuePointID)
    isPastCuePoint(sound(channelNum), 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, SWA), 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.

Example

This statement plays a sound until the third time the cue point Chorus End is passed:

    if (isPastCuePoint(sound 1, "Chorus End")=3) then
    	puppetSound 0
    end if

Example

This displays information in cast member "field 2" about the music playing in sound channel 1. If the music is not yet past cue point "climax", the text of "field 2" is "This is the beginning of the piece." Otherwise, the text reads "This is the end of the piece."

    if not sound(1).isPastCuePoint("climax") then
    		member("field 2").text = "This is the beginning of the piece."
    	else
    		member("field 2").text = "This is the end of the piece."
    end if

See also

`cuePointNames`, `cuePointTimes`, `mostRecentCuePoint`, `on cuePassed`