EasyManua.ls Logo

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT - Page 637

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT
816 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Sound.setTransform() 637
Mono sounds play all sound input in the left speaker and have the following transform settings
by default:
ll = 100
lr = 100
rr = 0
rl = 0
Example
The following example illustrates a setting that can be achieved by using setTransform(), but
cannot be achieved by using
setVolume() or setPan(), even if they are combined.
The following code creates a new
soundTransformObject object and sets its properties so that
sound from both channels will play only in the left channel.
mySoundTransformObject = new Object;
mySoundTransformObject.ll = 100;
mySoundTransformObject.lr = 100;
mySoundTransformObject.rr = 0;
mySoundTransformObject.rl = 0;
To ap ply t h e soundTransformObject object to a Sound object, you then need to pass the object
to the Sound object using
setTransform() as follows:
my_sound.setTransform(mySoundTransformObject);
The following example plays a stereo sound as mono; the soundTransformObjectMono object
has the following parameters:
mySoundTransformObjectMono = new Object;
mySoundTransformObjectMono.ll = 50;
mySoundTransformObjectMono.lr = 50;
mySoundTransformObjectMono.rr = 50;
mySoundTransformObjectMono.rl = 50;
my_sound.setTransform(soundTransformObjectMono);
This example plays the left channel at half capacity and adds the rest of the left channel to the
right channel; the
soundTransformObjectHalf object has the following parameters:
mySoundTransformObjectHalf = new Object;
mySoundTransformObjectHalf.ll = 50;
mySoundTransformObjectHalf.lr = 0;
mySoundTransformObjectHalf.rr = 100;
mySoundTransformObjectHalf.rl = 50;
my_sound.setTransform(soundTransformObjectHalf);
See also
Object class

Table of Contents

Related product manuals