
Sound.setVolume() Method
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Alphabetical Language Reference
|
789
// Apply the new channel distribution by passing the transform
// object to the setTransform() method
mySound.setTransform(transformer);
See Also
Sound.getTransform(), Sound.setPan(), Sound.setVolume()
Sound.setVolume() Method
set the volume of sounds controlled by a Sound object
Flash 5
soundObject.setVolume(volume)
Arguments
volume A number indicating the loudness of the sound controlled by soundObject,
where 0 is no volume (mute). The larger
volume’s absolute value (regardless of
whether
volume is positive or negative), the louder the sounds controlled by
soundObject will be. For example, –50 is the same volume as 50. The default
value for
volume is 100.
Description
The setVolume() method makes the sounds controlled by soundObject louder or softer. To
entirely mute a sound, use a
volume of 0. To make a sound louder, increase volume’s abso-
lute value. Values in the range of 100–200 are generally quite loud, but there is no
predefined maximum.
Note that setVolume() affects all the sounds controlled by
soundObject.IfsoundObject is a
global sound, setVolume() affects all the sounds in a movie. If
soundObject is tied to a clip
or a main timeline, setVolume() affects all the sounds in that clip or timeline.
The volume set by setVolume() remains ...