Name

Sound.getVolume( ) Method — retrieve the current volume setting

Availability

Flash 5

Synopsis

soundObject.getVolume( )

Returns

A number indicating the current volume as set by setVolume( ). Usually in the range (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( )

Get ActionScript: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.