
323
Example
This statement checks the sprite type the behavior is being attached to and returns
TRUE
for any
graphic sprite except a shape and
FALSE
for the script channel:
on isOKToAttach me, aSpriteType, aSpriteNum
case aSpriteType of
#graphic: -- any graphic sprite type
return sprite(aSpriteNum).member.type <> #shape
-- works for everything but shape cast members
#script: --the frame script channel
return FALSE -- doesn’t work as a frame script
end case
end
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, 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.
Examples
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
Содержание DIRECTOR MX-LINGO DICTIONARY
Страница 1: ...Lingo Dictionary Macromedia Director MX...
Страница 756: ...Index 756...