# Flv volume slider

**URL:** <https://forum.kirupa.com/t/flv-volume-slider/263690>\
**Category:** flash\
**Created:** [June 18, 2008, 11:07am UTC](https://forum.kirupa.com/t/flv-volume-slider/263690 "2008-06-18T11:07:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![triad](https://avatars.discourse-cdn.com/v4/letter/t/59ef9b/32.png) [@triad](https://forum.kirupa.com/u/triad)\
**Post date:** [June 18, 2008, 11:07am UTC](https://forum.kirupa.com/t/flv-volume-slider/263690/1 "2008-06-18T11:07:39Z")

</div>

Hi there people

I am trying to add a volume slider to my flv player, I currently have just a mute button  
Please help me.Ⓜ

Cheers

My code is as below

var nc:NetConnection = new NetConnection();  
nc.connect(null);  
var ns:NetStream = new NetStream(nc);  
theVideo.attachVideo(ns);  
ns.setBufferTime(10);  
ns.onStatus = function(info) {  
trace(info.code);  
if(info.code == “NetStream.Buffer.Full”) {  
bufferClip.\_visible = false;  
}  
if(info.code == “NetStream.Buffer.Empty”) {  
bufferClip.\_visible = true;  
}  
if(info.code == “NetStream.Play.Stop”) {  
ns.seek(0);  
}  
}  
ns.play(“eclips.flv”);  
playButton.onRelease = function() {  
ns.pause();  
}  
rewindButton.onRelease = function() {  
ns.seek(0);  
}  
var videoInterval = setInterval(videoStatus,100);  
var amountLoaded:Number;  
var duration:Number;  
ns[“onMetaData”] = function(obj) {  
duration = obj.duration;  
}  
function videoStatus() {  
amountLoaded = ns.bytesLoaded / ns.bytesTotal;  
loader.loadbar.\_width = amountLoaded \* 208.9;  
loader.scrub.\_x = ns.time / duration \* 208.9;  
}  
var scrubInterval;  
loader.scrub.onPress = function() {  
clearInterval(videoInterval);  
scrubInterval = setInterval(scrubit,10);  
this.startDrag(false,0,this.\_y,208,this.\_y);  
}  
loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {  
clearInterval(scrubInterval);  
videoInterval = setInterval(videoStatus,100);  
this.stopDrag();  
}  
function scrubit() {  
ns.seek(Math.floor((loader.scrub.\_x/208)\*duration));  
}  
var theMenu:ContextMenu = new ContextMenu();  
theMenu.hideBuiltInItems();  
\_root.menu = theMenu;  
var item1:ContextMenuItem = new ContextMenuItem("::::: Video Controls :::::",trace);  
theMenu.customItems[0] = item1;  
var item2:ContextMenuItem = new ContextMenuItem(“Play / Pause Video”,pauseIt,true);  
theMenu.customItems[1] = item2;  
var item3:ContextMenuItem = new ContextMenuItem(“Replay the Video”,restartIt);  
theMenu.customItems[2] = item3;  
var item4:ContextMenuItem = new ContextMenuItem(“© 2005 Lee Brimelow”,trace,true);  
theMenu.customItems[3] = item4;  
function pauseIt() {  
ns.pause();  
}  
function stopIt() {  
ns.seek(0);  
ns.pause();  
}  
function restartIt() {  
ns.seek(0);  
}  
\_root.createEmptyMovieClip(“vSound”,\_root.getNextHighestDepth());  
vSound.attachAudio(ns);  
var so:Sound = new Sound(vSound);  
so.setVolume(100);  
mute.onRollOver = function() {  
if(so.getVolume()== 100) {  
this.gotoAndStop(“onOver”);  
}  
else {  
this.gotoAndStop(“muteOver”);  
}  
}  
mute.onRollOut = function() {  
if(so.getVolume()== 100) {  
this.gotoAndStop(“on”);  
}  
else {  
this.gotoAndStop(“mute”);  
}  
}  
mute.onRelease = function() {  
if(so.getVolume()== 100) {  
so.setVolume(0);  
this.gotoAndStop(“muteOver”);  
}  
else {  
so.setVolume(100);  
this.gotoAndStop(“onOver”);  
}  
}

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [June 18, 2008, 11:24am UTC](https://forum.kirupa.com/t/flv-volume-slider/263690/2 "2008-06-18T11:24:04Z")

</div>

A place code in quotes at least

I suspect you have jivvyed the audio, look at lees tut, copy his audio attach element then hybrid it with kirupa

I don’t see why you are placing the audio in a MC
