|
-
control timeline sound volume
To use that to mute your sound, put that code inside of a function called by an mouse-click eventlistener attatched to your button....
muteVol_btn.addEventListener(MouseEvent.CLICK, muteVolume);
function muteVolume(evt:MouseEvent):void{
var myTransform:SoundTransform=SoundMixer.soundTransfo rm;
myTransform.volume=0; //mutes sound
SoundMixer.soundTransform=myTransform;
}
you could make other buttons for other sound control...
halfVol_btn.addEventListner(MouseEvent.CLICK, halfVolume);
function halfVolume(evt:MouseEvent):void{
var myTransform:SoundTransform=SoundMixer.soundTransfo rm;
myTransform.volume=.5;
/* volume is half as loud, change this number anything from 0 to 1 for mute to full sound */
SoundMixer.soundTransform=myTransform;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|