![MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING Reference Download Page 843](http://html1.mh-extra.com/html/macromedia/director-mx-2004-director-scripting/director-mx-2004-director-scripting_reference_3321720843.webp)
loopCount
843
If the
loop
property is turned off while the movie is playing, the movie continues to play.
Director stops when it reaches the end of the movie.
This property can be tested and set. The default setting is [0,0].
Example
This sprite script sets the starting and ending times for looping within a QuickTime sprite. The
times are set by specifying seconds, which are then converted to ticks by multiplying by 60.
-- Lingo syntax
on beginSprite me
sprite(me.spriteNum).loopBounds = [(16 * 60),(32 * 60)]
end
// JavaScript syntax
function beginSprite() {
sprite(me.spriteNum).loopBounds = list((16 * 60),(32 * 60));
}
loopCount
Usage
-- Lingo syntax
soundChannelObjRef
.loopCount
// JavaScript syntax
soundChannelObjRef
.loopCount;
Description
Sound Channel property; specifies the total number of times the current sound in a sound
channel is set to loop. Read-only.
The default value of this property is 1 for sounds that are simply queued with no internal loop.
You can loop a portion of a sound by passing the parameters
loopStartTime
,
loopEndTime
, and
loopCount
with a
queue()
or
setPlayList()
method. These are the only methods for setting
this property.
If
loopCount
is set to 0, the loop will repeat forever. If the sound cast member’s
loop
property is
set to
TRUE
,
loopCount
will return 0.
Example
This handler queues and plays two sounds in sound channel 2. The first sound, cast member
introMusic, loops five times between 8 seconds and 8.9 seconds. The second sound, cast member
creditsMusic, loops three times. However, no
#loopStartTime
and
#loopEndTime
are specified,
so these values default to the
#startTime
and
#endTime
, respectively.
-- Lingo syntax
on playMusic
sound(2).queue([#member:member("introMusic"), #startTime:3000, \
#loopCount:5, #loopStartTime:8000, #loopEndTime:8900])
sound(2).queue([#member:member("creditsMusic"), #startTime:3000, \
#endTime:3000, #loopCount:3])
sound(2).play()
end playMusic
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...