0

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!

Josip
  • 13
  • 4

1 Answers1

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