Flash CS3 + AS 3.0 Mute and enable sound

Maybe someone can help quickly turn off or turn on the sound of the scene in Flash CS3 using AS 3.0.

thanks

+3
source share
2 answers

What you want is the SoundMixer class. Just set the soundTransform object for this as follows:

Mute:

SoundMixer.soundTransform = new SoundTransform(0);

Unmute:

SoundMixer.soundTransform = new SoundTransform(1);
+12
source

Put this line in your script if you want to stop the sound:

SoundMixer.stopAll();
+2
source

Source: https://habr.com/ru/post/1716591/


All Articles