Sound.getVolume( ) Method

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By 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( )



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net