Add a Sound Mute Button to a Video Object -
in flash actionscript 3.0. have added video object stage attaching camera , video classes. have created simple mute/unmute button. want embed sound button video object give clients more options. there anyway can incorporate mute button video object? code: wont display here appreciated!!
var nc:netconnection = new netconnection(); nc.addeventlistener(netstatusevent.net_status, nethandler); nc.connect(rtmfp://example); cam:camera = camera.getcamera(); var vid:video = new video(); camera.setmode(720,540,15,true); camera.setquality(0, 100); vid.attachcamera(cam); video.width = camera.width; video.height = camera.height; addchild(vid); function setmute(vol){ var stransform:soundtransform = new soundtransform(1,0); stransform.volume = vol; soundmixer.soundtransform = stransform; } var ismuted:boolean = false; mute_btn.addeventlistener(mouseevent.click, togglemutebtn); function togglemutebtn(event:mouseevent):void{ if(ismuted){ ismuted = false; setmute(1); } else { ismuted = true; setmute(0);
once have added video stage, can this;
video.soundtransform = new soundtransform(0.5);
or in situation, like...
function setmute(vol) { root.video.soundtransform = new soundtransform(vol); }
Comments
Post a Comment