1 Reply Latest reply on Mar 4, 2010 5:53 AM by Ned Murphy

    volume slider collides with mute button

    Zeeek_90

      _root.createEmptyMovieClip("vsound",_root.getNextHighestDepth())
      vSound.attachAudio(ns);

       

      var so:Sound = new Sound(vSound);

       

      mainBar.volSlider.drag.onEnterFrame = function ()
      {
          so.setVolume(-50 - this._x);
          vol = _root.volSlider.drag._x + 50;
          volAt = Math.round (vol);
      }

       

      mainBar.volSlider.drag.onRelease = function()
      {
          stopDrag();
      }

       

      mainBar.volSlider.drag.onReleaseOutside = function()
      {
          stopDrag();
      }

       

      mainBar.volSlider.drag.onPress = function()
      {
          startDrag(this, false, -50, this._y, 49, this._y);
      }

       

      mainBar.muteBut.onRollOver = function()
      {
          if(so.getVolume() <= 100)
          {
              this.gotoAndStop("onOver");
          }
          else
          {
              this.gotoAndStop("muteOver");
          }
      }

       

      mainBar.muteBut.onRollOut = function()
      {
          if(so.getVolume() <= 100)
          {
              this.gotoAndStop("on");
          }
          else
          {
              this.gotoAndStop("mute");
          }
      }

       

      mainBar.muteBut.onRelease = function()
      {
          if(so.getVolume() <= 100)
          {
              so.setVolume(0);
              this.gotoAndStop("muteOver");
          }
          else
          {
              so.setVolume(100);
              this.gotoAndStop("onOver");
          }
      }     

       


      Before i had the volume slider, the mute button was fine. but now, it doesn't work anymore.

       

      anyone?

        • 1. Re: volume slider collides with mute button
          Ned Murphy Adobe Community Professional & MVP

          What is the following code doing:

           

          mainBar.volSlider.drag.onEnterFrame = function ()
          {
              so.setVolume(-50 - this._x);
              vol = _root.volSlider.drag._x + 50;
              volAt = Math.round (vol);
          }

           

          I ask because onEnterFrame code will continuously execute, and it may be the case that it is resetting any mute action taken as fast as it happens.  It may also be inhibiting your volume control from being a volume control.