# Making a FLV player : pb with the mute btn and volume slider

**URL:** <https://forum.kirupa.com/t/making-a-flv-player-pb-with-the-mute-btn-and-volume-slider/221447>\
**Category:** flash\
**Created:** [April 4, 2007, 12:34pm UTC](https://forum.kirupa.com/t/making-a-flv-player-pb-with-the-mute-btn-and-volume-slider/221447 "2007-04-04T12:34:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![5TEF](https://avatars.discourse-cdn.com/v4/letter/5/85e7bf/32.png) [@5TEF](https://forum.kirupa.com/u/5TEF)\
**Post date:** [April 4, 2007, 12:34pm UTC](https://forum.kirupa.com/t/making-a-flv-player-pb-with-the-mute-btn-and-volume-slider/221447/1 "2007-04-04T12:34:02Z")

</div>

Hi,

i’m currently making a FLV player.  
all work fine, except the mute+volume slider.

without pressing mute button, the slider work very well.

when i mute, the sound stop ( great 🙂 )  
when i re-press on mute, the sound re-start with the slider value for volume.

but my slider don’t work !

another question:  
how to rewind my video with the stream cursor ?  
( i’m using Flash MX2004, so, onMetaData don’t seem to work ).

here my code:

```auto

//-------VOLUME SLIDER ------
volumeSyst.volCursor.onPress = function() {
    this.startDrag(true, 0, 9, volumeSyst.volBar._width, 9);
    this.onEnterFrame = function() {
        _global.monVolume = Math.round(volumeSyst.volCursor._x/(volumeSyst.volBar._width/100));
        so.setVolume(monVolume);
        trace(monVolume);
    };
};
volumeSyst.volCursor.onRelease = volumeSyst.volCursor.onReleaseOutside=stopDrag;
//--
_root.createEmptyMovieClip("vSound", _root.getNextHighestDepth());
vSound.attachAudio(ns);
var so:Sound = new Sound();
so.setVolume(monVolume);
//---------------------------------
mute.onRelease = function() {
    if (testVol == false) {
        trace("volume à 100");
        testVol = true;
        monVolume = Math.round(volumeSyst.volCursor._x/(volumeSyst.volBar._width/100));
        this.gotoAndStop("sound");
    } else {
        testVol = false;
        monVolume = monVolume-monVolume;
        this.gotoAndStop("mute");
    }
};

```
