Sound.getPan( ) Method

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

retrieve the last pan value set
soundObject.getPan()

Returns

A number indicating the last value set by setPan( ). Usually in the range of -100 (left channel on, right channel off) to 100 (right channel on, left channel off). Default value is 0 (left and right channels in equal proportions).

Description

By adjusting the pan of a sound, you can create the illusion of a moving sound source. The getPan( ) method is used to determine the current distribution of the left and right channels of the sounds controlled by soundObject. Normally, getPan( ) is used in combination with setPan( ) to adjust the current pan of a sound.

Example

Here we alter the pan of a sound by 20 towards the left channel:

mySound = new Sound(); mySound.setPan(mySound.getPan() - 20);

See Also

Sound.getTransform( ), Sound.setPan( )



    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