I want to learn how to turn off (mute) the sound using ToggleSwitch component in Adobe Flash Builder 4.6. I plan to use the Android application. Thanks!
Asked
Active
Viewed 507 times
0
-
http://stackoverflow.com/questions/1362379/flash-cs3-as-3-0-mute-and-unmute-stage-volume – Antonos Oct 17 '12 at 08:00
1 Answers
0
Just add the "ToggleButton" to the stage and right-click it and choose "Generate click handler" and then paste this code.
protected function ToggleBtn_clickHandler(event:MouseEvent):void
{
switch(ToggleBtn.label)
{
case "Mute":
SoundMixer.soundTransform = new SoundTransform(0);
ToggleBtn.label="UnMute";
break;
case "UnMute":
SoundMixer.soundTransform = new SoundTransform(1);
ToggleBtn.label="Mute";
break;
}
}

Shankar Narayana Damodaran
- 68,075
- 43
- 96
- 126