Sound.setTransform()
699
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.
var mySoundTransformObject:Object = new Object();
mySoundTransformObject.ll = 100;
mySoundTransformObject.lr = 100;
mySoundTransformObject.rr = 0;
mySoundTransformObject.rl = 0;
To apply the
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:
var mySoundTransformObjectMono:Object = new Object();
mySoundTransformObjectMono.ll = 50;
mySoundTransformObjectMono.lr = 50;
mySoundTransformObjectMono.rr = 50;
mySoundTransformObjectMono.rl = 50;
my_sound.setTransform(mySoundTransformObjectMono);
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:
var mySoundTransformObjectHalf:Object = new Object();
mySoundTransformObjectHalf.ll = 50;
mySoundTransformObjectHalf.lr = 0;
mySoundTransformObjectHalf.rr = 100;
mySoundTransformObjectHalf.rl = 50;
my_sound.setTransform(mySoundTransformObjectHalf);
var mySoundTransformObjectHalf:Object = {ll:50, lr:0, rr:100, rl:50};
Also see the example for
Sound.getTransform()
.
See also
Object class
,
Sound.getTransform()
Summary of Contents for FLEX
Page 1: ...Flex ActionScript Language Reference ...
Page 8: ......
Page 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0 ...
Page 76: ......
Page 133: ...break 133 See also for for in do while while switch case continue throw try catch finally ...
Page 135: ...case 135 See also break default strict equality switch ...
Page 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while ...
Page 808: ...808 Chapter 7 ActionScript for Flash ...
Page 810: ...810 Appendix A Deprecated Flash 4 operators ...
Page 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code ...
Page 816: ...816 Appendix B Keyboard Keys and Key Code Values ...
Page 822: ...822 Index ...