Forum:	General Discussion
Téma:	How to Set Volume in Flash
----------------------------------

kasselbiddy:
Here is how you go about setting the volume of sound in Flash. There are two ways of setting volume, either on a per-channel basis or globally across all channels. Besides, here is a tutorial about how to convert SWF to MOV on Mac with a Mac SWF to MOV converter.

Before we dive in it is worth taking a quick look at the four main classes used when manipulating sound in Actionscript 3.0. 
* Sound
An object representing an individual sound. This may be a sound effect or music loop.
* SoundChannel
A channel which plays a single Sound object.
* SoundTransform
Class used to manipulate the volume and/or panning of a sound.
* SoundMixer
A class containing static methods for controlling the global output of sound in a SWF.
Setting the volume of an individual sound
We can set the volume of a single sound channel at two distinct occasions, when the SoundChannel is instantiated as a result of calling the play method of a Sound instance, or we can alter the volume of an already existing SoundChannel.
Volume is set via an instance of the SoundTransform class. A SoundTransform instance is simply applied to the soundTransform property of a SoundChannel. Here we apply a SoundTransform instance with a volume of 0.5 to an existing SoundChannel called myMusicSoundChannel.
myMusicSoundChannel.soundTransform = new SoundTransform(0.5);
Note the volume value is specified as a number between 0 (silent) and 1 (full volume).
Next we set the volume of a SoundChannel during it’s initialization. The Sound instance, mySound, is set to play a single time with a volume of 0.5.
var mySoundChannel:SoundChannel = mySound.play( 0, 0, new SoundTransform(0.5) );
Setting volume globally
Setting the global volume of sound in your SWF is very similar to setting the volume of a single sound. The main difference is that we aren’t manipulating a single SoundChannel instance, rather we use the SoundMixer class.
SoundMixer.soundTransform = new SoundTransform(0.5);

ivy00135:
&#29275;&#23567;&#24351;&#29275;&#25490;
&#27365;&#31383;&#28407;&#21619;
&#22825;&#25165;&#32769;&#23229;&#38617;&#34507;&#34485;&#20180;&#29006;
&#29190;&#31859;&#33457;
&#27861;&#24335;&#21487;&#27138;&#39173;
&#40573;&#27700;&#24847;&#40629;
&#39640;&#38596;&#37202;&#24215;&#32147;&#32000;
&#35948;&#24515;&#20908;&#31881;
&#26519;&#23478;&#27700;&#39171;
&#38463;&#36066;&#26009;&#29702;
&#20809;&#33775;&#26408;&#29916;&#29275;&#22902;&#22823;&#29579;
&#36637;&#21733;&#40020;&#39770;&#24847;&#40629;
&#37202;&#24215;&#32147;&#28639;
&#20126;&#22521;&#28271;&#21253;&#33976;&#39171;
&#38463;&#20845;&#40020;&#39770;&#40629;
&#23404;&#21619;&#39321;&#33735;&#32905;&#32697;
&#33836;&#37324;&#32650;&#32905;&#24215;
&#23631;&#26481;&#35948;&#33139;
&#21129;&#26131;&#35352;&#29275;&#32905;&#20992;&#21066;&#40629;
&#37202;&#24215;&#23567;&#22992;
&#39640;&#38596;&#37202;&#24215;&#32147;&#32000;
&#26143;&#24231;&#36939;&#21218;2012
&#26143;&#24231;&#37197;&#23565;2012
&#29281;&#32650;&#24231;2012&#24180;&#26143;&#24231;&#36939;&#21218;
&#37329;&#29275;&#24231;2012&#24180;&#26143;&#24231;&#36939;&#21218;
&#38617;&#23376;&#24231;2012&#24180;&#26143;&#24231;&#36939;&#21218;
&#24040;&#34809;&#24231;2012&#24180;&#26143;&#24231;&#36939;&#21218;
&#29509;&#23376;&#24231;2012&#24180;&#26143;&#24231;&#36939;&#21218;
&#34389;&#22899;&#24231;2012&#24180;&#26143;&#24231;&#36939;&#21218;
&#22825;&#31204;&#24231;2012&#24180;&#26143;&#24231;&#36939;&#21218;
&#22825;&#34829;&#24231;2012&#24180;&#26143;&#24231;&#36939;&#21218;
&#23556;&#25163;&#24231;2012&#24180;&#26143;&#24231;&#36939;&#21218;
&#39764;&#32687;&#24231;2012&#24180;&#26143;&#24231;&#36939;&#21218;
&#27700;&#29942;&#24231;2012&#24180;&#26143;&#24231;&#36939;&#21218;
&#38617;&#39770;&#24231;2012&#24180;&#26143;&#24231;&#36939;&#21218;
