03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Parameters<br />

value:Number - An integer specifying the left-right balance for a sound. The range of valid<br />

values is -100 to 100, where -100 uses only the left channel, 100 uses only the right channel,<br />

<strong>and</strong> 0 balances the sound evenly between the two channels.<br />

Example<br />

See Sound.getPan() for a sample usage of this method.<br />

See also<br />

attachSound (Sound.attachSound method), getPan (Sound.getPan method),<br />

setTransform (Sound.setTransform method), setVolume (Sound.setVolume<br />

method), start (Sound.start method)<br />

setTransform (Sound.setTransform method)<br />

public setTransform(transformObject:Object) : Void<br />

Sets the sound transform (or balance) information, for a Sound object.<br />

The soundTransformObject parameter is an object that you create using the constructor<br />

method of the generic Object class with parameters specifying how the sound is distributed to<br />

the left <strong>and</strong> right channels (speakers).<br />

Sounds use a considerable amount of disk space <strong>and</strong> memory. Because stereo sounds use twice<br />

as much data as mono sounds, it is generally best to use 22-KHz 6-bit mono sounds. You can<br />

use setTransform() to play mono sounds as stereo, play stereo sounds as mono, <strong>and</strong> to add<br />

interesting effects to sounds.<br />

The properties for the soundTransformObject are as follows:<br />

ll - A percentage value specifying how much of the left input to play in the left speaker (0-<br />

100).<br />

lr - A percentage value specifying how much of the right input to play in the left speaker (0-<br />

100).<br />

rr - A percentage value specifying how much of the right input to play in the right speaker (0-<br />

100).<br />

rl - A percentage value specifying how much of the left input to play in the right speaker (0-<br />

100).<br />

The net result of the parameters is represented by the following formula:<br />

leftOutput = left_input * ll + right_input * lr<br />

rightOutput = right_input * rr + left_input * rl<br />

Sound 1129

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!