User Guide
357
Example
This handler displays an alert indicating how many times the loop in the cast member of sound 2
plays. If no loop has been set in the current sound of sound channel 2,
sound(2).loopCount
returns 1.
on showLoopCount
alert "The current sound’s loop plays" && sound(2).loopCount && "times."
end
See also
breakLoop(), setPlaylist(), loopEndTime, loopsRemaining, loopStartTime, queue()
loopEndTime
Syntax
sound(channelNum).loopEndTime
the loopEndTime of sound channelNum
Description
Sound property; the end time, in milliseconds, of the loop set in the current sound playing in
sound channel
channelNum. Its value is a floating-point number, allowing you to measure and
control sound playback to fractions of a millisecond.
This property can only be set when passed as a property in a
queue() or setPlaylist() command.
Example
This handler plays sound cast member introMusic in sound channel 2. Playback loops five times
between the 8 seconds point and the 8.9 second point in the sound.
on playMusic
sound(2).play([#member:member("introMusic"), #startTime:3000,\
#loopCount:5,#loopStartTime:8000, #loopEndTime:8900])
end
Example
This handler causes the text field TimWords to read "Help me, I’m stuck!" when the
currentTime of sound channel 2 is between its loopStartTime and loopEndTime.
on idle
if sound(2).currentTime > sound(2).loopStartTime and \
sound(2).currentTime < sound(2).loopEndTime then
member("TimWords").text = "Help me, I’m stuck!"
else
member("TimWords").text = "What’s this sticky stuff?"
end if
end
See also
breakLoop(), getPlaylist(), loopCount, loopsRemaining, loopStartTime, queue()