Mute / UnMute Sound AS3

If you need to mute/unmute a sound in a MovieClips timeline (eg. if you have a player that loads external swfs)
Try using SoundMixer and soundTransform like this:

1
2
3
4
5
6
7
8
import flash.media.SoundTransform;
import flash.media.SoundMixer;
 
// Mute - sets volume to 0
SoundMixer.soundTransform = new SoundTransform(0);
 
//UnMute - sets volume to 1 (100%)
SoundMixer.soundTransform = new SoundTransform(1);

Of course there are other ways to do it but this was exactly what I needed for my project and it worked just fine.
Feel free to comment other ways to do it.

Cheers!

  1. HUGH says:


    MedicamentSpot.com. Canadian Health&Care.Special Internet Prices.Best quality drugs.No prescription online pharmacy. Low price drugs. Buy drugs online

    Buy:Accutane.Human Growth Hormone.100% Pure Okinawan Coral Calcium.Retin-A.Valtrex.Prednisolone.Zovirax.Arimidex.Lumigan.Actos.Synthroid.Petcam (Metacam) Oral Suspension.Nexium.Mega Hoodia.Zyban.Prevacid….

  2. EDWIN says:


    CheapTabletsOnline.Com. Canadian Health&Care.Special Internet Prices.No prescription online pharmacy.Best quality drugs. Low price drugs. Buy pills online

    Buy:Viagra Super Active+.Cialis.Viagra Professional.Maxaman.Cialis Super Active+.Cialis Professional.Viagra.Viagra Super Force.Cialis Soft Tabs.Levitra.Soma.Viagra Soft Tabs.Tramadol.Super Active ED Pack.Zithromax.Propecia.VPXL….

Leave a Reply