3 Replies Latest reply on Jan 20, 2012 9:04 AM by Ned Murphy

    Invert Number of a volume slider

    sgtpepperss

      Hi,

       

      I made a volumeslider, but the problem is that the sound plays at 100% when the slider is down and at 0% when the slider is up.
      Of course every volumeslider does the opposite.

      Can anyone help me to adjust this code so down, the volume becomes 0% and up 100%?

       

       

       

       

       

      sliderVolume.onPress = function() {

          this.startDrag(false,150,150,150,250);

      }

       

      sliderVolume.onRelease = sliderVolume.onReleaseOutside = function() {

          this.stopDrag ();

          var volumePercentage: Number=100 - ((barVolume._y+barVolume._height) - this._y);

          mySong.setVolume(1*volumePercentage);

          txtVolumePercentage.text = volumePercentage+ "%";

      }

       

       

       

       

      Thanks,

      Geert