Chapter 12
324
These statements queue the sound members Explosion and Siren and play them in succession in
sound channel 2:
sound(2).queue(member("Explosion"))
sound(2).queue(member("Siren"))
sound(2).play()
To control how a queued sound plays:
•
Include optional parameters in a property list within the
queue()
function. See
queue()
in the
Lingo Dictionary.
When you use
setPlayList()
, any previously set queue of sounds is replaced by the
new playlist.
After queuing sounds, you can still control whether the queue is obeyed. You can select to
interrupt loops with the
breakLoop()
command or to pause playback with the
pause()
function. The
playNext()
command lets you skip immediately to the next sound in the queue.
For more information on sound commands, see the Lingo Dictionary.
Playing external sound files
In addition to playing sounds you have imported as cast members, you can also play external
sound files that have not been imported.
To play external sound files that aren’t cast members:
•
Use the
sound playFile
command. See
sound playFile
in the Lingo Dictionary.
Playing external sound files from disk minimizes the amount of RAM that is used to play sounds.
However, because the computer can read only one item from disk at a time, loading cast members
or playing more than one sound from disk can cause unacceptable pauses when you use the
sound
playFile
command.
Controlling sound channels
You can use Lingo to make actions in a movie dependent on whether a sound is playing. Lingo
lets you determine whether a sound is playing in a particular sound channel and control how a
channel plays sound. For more information on each of these commands, functions, and
properties, see the Lingo Dictionary.
•
To determine whether a specific channel is playing a sound, use the
isBusy()
function.
•
To turn off the current sound in a specific channel, use the
setPlayList()
command with
[ ]
as the new play list. This deletes the entire sound queue and leaves the current sound
playing. Use the
stop()
command to stop the currently playing sound.
•
To fade a specific channel’s sound in and out, use the
fadeTo()
function.
•
To control a specific sound channel’s volume, specify the
volume
property.
•
To control the left-to-right panning of a sound, specify the
pan
property.
Содержание DIRECTOR MX-USING DIRECTOR MX
Страница 1: ...Using Director MX Macromedia Director MX...
Страница 12: ...Contents 12...
Страница 156: ...Chapter 4 156...
Страница 202: ...Chapter 6 202...
Страница 244: ...Chapter 7 244...
Страница 292: ...Chapter 10 292...
Страница 330: ...Chapter 12 330...
Страница 356: ...Chapter 13 356...
Страница 372: ...Chapter 14 372...
Страница 442: ...Chapter 16 442...
Страница 472: ...Chapter 18 472...
Страница 520: ...Chapter 19 520...
Страница 536: ...Chapter 20 536...
Страница 562: ...Chapter 23 562...
Страница 566: ...Chapter 24 566...
Страница 602: ...Chapter 27 602...