3 Replies Latest reply on Aug 9, 2009 10:41 PM by webqaflash

    Mute button not working

    rlinsurf1

      Hi--

       

      This is a simple mute toggle button for an mp3 player.

       

      I first var sound: Sound

       

      Then I have the function

       

      //mute the current sound
      function muteSound ()
      {
           if(this.sound.getVolume != 0) this.sound.setVolume(0);
           else this.sound.setVolume(75);
      }
      

       

      Then I setup 4 frames in a movieClip, labelled on, onRoll, off and offRoll.

       

      Then this under button Actions

       

      // Mute Button
      buttonMute.onRollOver = function()
      {
           if(this._currentframe == 1) this.gotoAndStop("onRoll");
           else this.gotoAndStop("offRoll");
      }
      
      buttonMute.onRollOut = function()
      {
           if(this._currentframe == 2) this.gotoAndStop("off");
           else this.gotoAndStop("on");
      }
      
      buttonMute.onRelease = function()
      {
           if(this._currentframe == 2)
           {
                this.gotoAndStop("on");
                this._parent.muteSound();
           }
           else if(this._currentframe == 4)
           {
                this.gotoAndStop("on");
                this._parent.muteSound();
           }
           else
           {
                this.gotoAndStop("off");
                this._parent.muteSound();
           }
      }
      
      

       

      This all works graphically, the sound mutes the first time, and the graphics do change, but the sound never unmutes.

       

      Because I was asked before, here is a copy of the whole file:

       

      http://charlesnewmanpubl.com/player_fa2.zip