Mute and unmute button is actionscript 3.0

Hi,
I am wondering how to make a mute and unmute button is actionscript 3.0.  I did it before in actionscript 2.0 but not in 3.0.
Here is my actionscript 2.0 code.
var sound = 1;
var slashMC = _root.attachMovie("slash","slash01",99);
slash01._visible = false;
slashMC._y = btn._y;
slashMC._x = btn._x;
var s:Sound = new Sound();
s.attachSound("Gravy");
s.start(1,999);
btn.onPress = function(){
if(sound==1){
  s.stop();
  slash01._visible = true;
  sound = 0;
else if(sound==0){
  sound = 1;
  slash01._visible = false;
  s.start(1,999);
Thanks

Try this:
    import flash.display.MovieClip;
    import flash.events.*;
    import flash.media.*;
    import flash.net.URLRequest;
        var isPlaying:Boolean = false;
        var snd:Sound = new Sound();
        var channel:SoundChannel = new SoundChannel();
        var pos:Number = 0;
        var soundVolume:Number = 1;
            snd.load(new URLRequest("something.mp3"));
            btn_Stop.addEventListener(MouseEvent.CLICK, stopMusic);
            btn_Stop.buttonMode = true;
            btn_Play.addEventListener(MouseEvent.CLICK, playMusic);
            btn_Play.buttonMode = true;
         function stopMusic(evt:Event):void
            channel.stop();
            pos = 0;
            isPlaying = false;
         function playMusic(evt:Event):void
            if(!isPlaying)
                channel = snd.play(pos);
                btn_Play.visible = false;
                btn_Pause.visible = true;
                isPlaying = true;

Similar Messages

  • Not working mute and unmute buttons

    var myGlobalSound:Sound = new Sound();
    myGlobalSound.start(0, 99);
    playB.visible=true;
    stopB.visible=false;
    volControl_mc.dragger_mc._y = 0;
    volControl_mc.dragger_mc.onEnterFrame = function() {
            myGlobalSound.setVolume(0-this._x);
    volControl_mc.dragger_mc.onPress = function() {
            startDrag(this, false, 0, this._y, 41, this._y);
    volControl_mc.dragger_mc.onRelease = volControl_mc.dragger_mc.onReleaseOutside=function ()
            stopDrag();
    stopB.onRelease = function() {
           myGlobalSound.stop();
            playB.visible=true;
            stopB.visible=false;
    playB.onRelease = function() {
            myGlobalSound.start(0, 99);
            playB.visible=false;
            stopB.visible=true;
    But not working mute and unmute buttons.  ??????

    you're using an flvplayback component?  if yes, open the flash helpfiles and check the section on the flvplayback class.

  • Am using ipad air, my question is under accessibility mute and unmute button is not working.

    pls help me am using ipad air, under accesibility the mute and unmute button are not working.

    Do you mean that you have Settings > General > Use Side Switch To set to 'Mute', and you have the switch on the right-hand side of your iPad, above the volume control, 'on' ? WIth that 'on' notification sounds should be muted (e.g. email notifications, game sounds etc), but the you should still be able to hear the Videos and Music apps and with headphones. Is that not happening, and if not you've tried toggling the switch on the side of your iPad on/off ?
    iPad side switch : http://support.apple.com/kb/HT4085

  • How can I mute and unmute my Mic using the button ...

    I have a button on my mic that is a play/pause button. It works fine when playing music on my phone. Can I use this button to mute and unmute my mic when using skype? The Volume up and down buttons already work. Thanks

    That cable set up you have is probably not going to work.  The iOS devices seem a little sensitive to having the right connector for the right job.  I have the USB connector (and the HDMI one too) which is in 2 parts: mini USB link and SD. My older Nikon D70s does not use SD cards, so I use the cable. When connected any images on the card (in the camera) are displayed in the built-in Photo app in an Imports album.  Just touch the Import button and all are brought in.  I use RAW and have found that the RAW images are transferred to the computer (MacBook Pro + Aperture) when I get home.  A comparison (I kept the images on the card and imported from that too) shows that the resolution/size is identical.  As an additional note as you mentioned this, video clips work the same.
    With all the connectors, I carry a small bag for the devices I work with.

  • Meeting Place 8.0 - Mute and Unmute Particular Participant

    Hi,
    I have setup of Meeting place 8.0 Application Server (Express Media Server) and Web Server 8.0
    Problem is when Meeting Chairperson (host), who schedules a meeting, can't Mute/ unmute other attendees (Particular Ones) in same meeting (Act as a moderator).
    Now, If we provide Attendant privilege to the host, we gets those rights to Mute and Unmute of that meeting As well As all the other meetings running(which is an problem).
    Can we have a meeting Chairperson with Mute/ Unmute access (Particular Ones) for only meeting which has been hosted by him.
    Please provide some valuable inputs on the same.
    Thanks & Regards,
    Ashish Bagla

    Hi Ashish,
    If you have MeetingPlace Audio only solution, from telephone user interface there is no possible way to mute individual participants. You, as a host, can mute only all participants, and then individual participants can unmute themselves if they want to say something.
    The only other alternative is to use Conference Manager. However, to be able to use this tool, the user/host has to be either Attendant or System Administrator type of user.
    More about Conference Manager you can find here:
    1. How to install Conference Manager:
    http://docwiki.cisco.com/wiki/Cisco_Unified_MeetingPlace_Release_8.0_--_Installing_MeetingPlace_Conference_Manager
    2. How to use Conference Manager:
    http://docwiki.cisco.com/wiki/Cisco_Unified_MeetingPlace_Release_8.0_--_Using_MeetingPlace_Conference_Manager
    I hope this will help.
    -Dejan

  • T410 - Can not use mute and volume button.

    Dear all
    I have a Think pad T410. The Mute and Volume button can not work when the Windows Vista is fully loaded.
    But it works in following case:
    - On Ubuntu
    - When Windows Vista is still loading.
    I guess it's conflict with some of Thinkpad Driver or Windows update.
    Did you experience it? Can you advice me how to solve it?

    I would re-install the Lenovo Hotkeys software and see if that helps.

  • NB205 Win 7 - Speaker Mute and Unmute

    Hi everyone, thanks for this thread -- indeed, very helpful.
    I have a different issue under Windows 7 -- I can never reliably mute or unmute the NB205. Even if I click the mute icon (after clicking the volume icon in the taskbar), sound still plays through the speaker. The speaker icon in the taskbar is also stuck on 'mute.'
    Of course, I could just reduce and raise the volume as needed, but the permanent mute icon on the taskbar drives me nuts.
    I'm hoping that a driver re-install fixes this. I had a feeling that it's my Windows installation, but I have another machine with the same version of windows that does not reproduce the issue.
    Do any NB205/Win7 users have this problem? If not, can any Win7 users mute and unmute the netbook a few times to try and reproduce it? Thanks again!
    [Admin  - split from another thread, edited title]
    Solved!
    Go to Solution.

    hi, this is the closest thread that i found to my problem, i recently got a virus on my nb205 and i got it removed but the problem is that now there is absolutely no sound at all.. even when i start it up theres no little start up tone i cant even listen to my music ..... i checked all the sound things, nothings on mute and... is there anything that i could download or do that could bring the sound back?

  • Win 8.1 Sound mutes and unmutes randomly

    Over the past week or so I have experienced a problem with the audio on my HP Envy Touchsmart 15-j002ax Notebook
    Randomly, my sound will mute/unmute itself, sometimes many times in a row. I'm using the built in Radeon HD Audio with the newest HP drivers (according to the HP Support website)
    When the speakers mute or unmute an icon appears automatically in the top let hand side of the the screen and it displays the percentage of volume, the same as the speakers icon in the system tray. However the percentage is displayed in a black box icon and is not the normal speaker icon. The f6 key on my keyboard illuminates when the random mute occurs and disappears when the random unmute occurs. Depressing the f6 key when a mute occurs does nothing. However pressing the volume adjustment keys f7 or f8 unmutes the speakers. Also if I display the system tray speaker icon and click the mute symbol the sound is unmuted
    However, the random muting and unmuting keeps occurring and I cannot control it or any length of time

    Hello, @jgunner1948 
    It appears that you're having issues with the audio in your notebook, that it's being randomly muted and unmute. I will attempt to assist you.
    Start with this document: No Sound from the Speakers (Windows 8). This may have steps that can help you.
    If nothing there helps, go into Device Manger > sound, video and game controllers > right click on the audio driver(s) choose to uninstall (make sure to check the box to delete the driver).
    Download these drivers: HP ENVY TouchSmart 15-j002ax Notebook PC Drivers (which you may have) and install. Restart your notebook.
    If this fails to help, try a System Refresh.
    Start with this, let me know how it goes for you.
    Thank you for posting on the HP Forums.
    I worked on behalf of HP.

  • My lenovo sl510 mic mute and light button not working

    The mic mute button lights up if the sound is muted. However, for the mic, there's no light, whether the mic is muted or not. Is there anybody else who sees the issue? Any solutions?

    i had this problem but i installed a new os and installed all the updates and drivers from lenovo's system update and i worked perfectly again(old windows:windows XP     new windows:windows 7)

  • Enabling and disabling buttons in actionscript

    in flex i love using the enabled option for buttons (so when the user has not yet selected something in a datagrid or if a variable in the app is not properly set the button will not be enabled and will be grayed out... but once the condition is true the button automatically becomes enabled) like this:
    <mx:Button 
    label="Save Changes" icon="@Embed(source='images/disk.png')" click="saveData();"enabled="
    {firstID != 0 &amp;&amp; changesMade == true}"/>
    i have a control bar that has buttons but if the user is an Admin they have additional buttons (which i created using actionscript in an initApp() function once the app initializes like this):
     if (adminList.indexOf(Application.application.parameters.emplid) != -1){ 
    var but:Button = new Button();but.label =
    "Delete Account";but.addEventListener(
    "click",confirm);but.setStyle(
    "icon", deleteIcon);  
    this.toolbar.addChild(but);}
    how can i code the enabled function that i use i mxml in actionscript in the code above?

    oops i just realized i forgot the return type.
    this is helpful when the button is first created and the app is first initialized... but i need this button to automatically become enabled if the user does something (like click on a datagrid) and automatically disabled when the user clicks off of the datagrid (or some action that would enable/disable the button).
    public function loadAdmins(returnedEvent:ResultEvent):void {adminList = returnedEvent.result[0].DEPT_LIST;
    if (adminList.indexOf(Application.application.parameters.emplid) != -1){ 
    var delBtn:Button = new Button();delBtn.label =
    "Delete Account";delBtn.addEventListener(
    "click",confirm);delBtn.setStyle(
    "icon", deleteIcon);delBtn.enabled=delBtnEnabled();
    this.toolbar.addChild(delBtn);}
    public function delBtnEnabled():Boolean{ 
    var returnVal:Boolean; 
    if (firstID != 0){returnVal =
    true;}
    else{returnVal =
    false;}
    return returnVal;}

  • Mute and unmute audio in video clips

    Making an hour long movie. I only want the original movie sound on 2 or 3 clips - the rest my own music. In the past I did it by dragging the movie sound (in Box A) to bottom to mute it then raising it where I wanted it to be heard. However, this would be a royal pain in this case. Is there a way to uncheck the original movie sound where I want my own music, then check it where I want to hear it? I can't seem to do so without making it all heard or none. Can anyone help with a quick way of doing this? Thanks,
    Max

    Hi Max:
    You can extract all of the original audio. It will show up on the second line of the timeline.
    Click on one of the extracted audio clips and Edit >'select All". Use the volume slider to mute all of the clips to "0".
    If they aren't already, you will need to split the audio where you want to hear it and go back to the volume slider and increase the volume there.
    Man, I'm not a very good teacher-hope you understood that one!
    Sue

  • How can I keep iPhone 5 mute and viberated for all the sounds and notifications with the mute button on?

    If turn on the mute button, my iphone 5 is mute. But I can not get informed if the alarm or timer ends. iPhone 5 is mute and doesn't viberate. I want it mute but viberate under the mute button.
    The Timer cann't viberate with the mute button on. I want it viberates without sound especially when I study in the Liberaby. I need to practice my pace with the Timer. I don't know whether it is because of my mistaken operation or because of the fact that the iPhone 5 can not make it.
    I think it should work like this, the mute button can mute all the sounds and notifications and at the same time, the phone can viberate  to keep me informed when a new email comes or there is a twett or the timer ends with viberation.
    How to set the dialpad tone? It is silly to dia a number with a tone.

    This forum is actually about the Cloud, not about using individual programs
    Once your program downloads and installs with no errors, you need the program forum
    If you start at the Forums Index http://forums.adobe.com/index.jspa
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says ALL FORUMS) to open the drop down list and scroll
    http://forums.adobe.com/community/lightroom

  • HT4085 are third party media apps (youtube, grooveshark, etc.) grouped in the muted or unmuted category?  Since music and podcast (default apps) DO mute and games DON'T mute I thought it worth asking.

    are third party media apps (youtube, grooveshark, etc.) grouped in the muted or unmuted category?  Since music and podcast (default apps) DO mute and games DON'T mute I thought it worth asking.

    It shows Peter's doing its jobs properly.
    Anyway there is no more communication from Sony since awihle. If you can have any news.
    Anyway good job Zero!

  • Disable "Mute" and "add call" buttons Lumia 635 Wi...

    10/9/14
    I have a new Lumia 635.
    ATT is carrier.
    Very often whike in the middle of a call my ear must touch the "mute" and the "Add a call" button...becaue I'll be talking way and the phone is "muted"...
    I am a male with long hair...
    I believe the proximity switch s working "half so"...
    I need to just disable there buttons....
    How do I either disable or move them???
    Please reply to *******@outlook.com
    Moderator's Note: We have edited your email address for security purposes. 

    Hi, bucbean.
    Welcome to our community.
    Latest software release for the Nokia Lumia 635 is 01061.00066.14235.36xxx. You can confirm if your phone have it by going to Settings> about> more info. To update your phone in case it is not updated yet, go to Settings> phone update> check for updates.
    Disabling such features on your phone is not available. We still value your idea and we will appreciate it if you will share it here: https://windowsphone.uservoice.com/forums/101801-feature-suggestions. 
    We understand you. However, the Nokia Support Discussions is a user-to-user troubleshooting and support forum where users can seek workable solutions to the issues they are having with their Nokia devices or Nokia services. There are other ways to contact the Nokia support team. You can do that by visiting your local support page here: http://www.microsoft.com/en/mobile/support/locations/. 
    If you have other concerns, do not hesitate to let us and other forum members know. May you have a good one.

  • After last update the split keyboard option is not working and side switch button option works opposite for mute and rotation lock

    After last update the split keyboard option is not working and side switch button option works opposite for mute and rotation lock.

    Hi
    A long story about your issue... I think the reason of this is why you have deleted some registry keys. If you delete something in the Windows registry you should really know what you do. You can damage the complete Windows system!
    So I think this is the reason why the keyboard doesnt anymore.
    In the user manual I have founded that the CD-ROM booting option is only available with optional optical disk drive.
    So for me it sounds like that your USB CD drive is not compatible to the notebook

Maybe you are looking for

  • ICal a doesn't load events on my iPad

    I've noticed that often, not always, when I click iCal on my iPad and the current month pops up, it shows a blank calendar.  If I select the month prior, it pulls up that calendar with events on it and then, if I re-select the current month, the cale

  • CLEAN_REQREQ_UP  SRM5.5 - Question re field entry

    Hi Within SRM5.5 for clean_reqreq_up, in the classic scenario,  does the logical system field require an entry ie the backend system or should it be left blank ? The reason for the question is that if a held LOCAL PO is deleted,  the end users check

  • Is it possible to use Airplay on AppleTV without a TV?

    Hi everyone, I had an apple airport and was able to play pandora through it just using my iphone 4s and stereo system (an old boombox that takes a regular 3.5 mm plug). I got rid of my Airport and got an AppleTV under the impression I could use the a

  • How can we open any file using JAVA...

    Hi all i trying to make code in that code i choose a file using a filechooser then put that file name in FILE object like (File file = fileChooser.getSelectedFile();) but the thing is how can i open that file for example if that file is HTML file the

  • Sync questions? Comcast address book? Not sync every time I connect Ipad?

    Hi|! Still working on learning this wonderful tool! Is there a way to pull in my comcast address book? how can I make my ipad NOT sync every time I hook it to my computer? Can I just drag and drop a new movie onto it? Do you use a screen protector? T