ActionScript for Flash MX: The Definitive Guide, Second Edition

ActionScript for Flash MX: The Definitive Guide, 2nd EditionBy Colin Moock
Chapter 18.  ActionScript Language Reference
Sound.getVolume( ) Method Flash 5

retrieve the current volume setting

soundObject.getVolume()

Returns

A number indicating the current volume as set by setVolume( ). Usually in the range of 0 (no volume) to 100 (default volume), but it can be higher.

Description

The getVolume( ) method is used to determine the current volume of the sounds controlled by soundObject. Normally, getVolume( ) is used in combination with setVolume( ) to adjust the current volume of a sound.

Example

Here we reduce the volume of a sound by 20:

mySound = new Sound(); mySound.setVolume(mySound.getVolume() - 20);

See Also

Sound.setVolume( )

    Категории