Problem with volume slider

I created a volume slider using the “Slider Bars” tutorial and the “Creating a Volume Slider” tutorial, and everything works, excepts when the sound starts it starts at 0 volume. Well, it actually starts at 100 but very quickly jumps to 0. But then when you click on the slider it goes to the volume of the slider level. All of my code is the same as in the two tutorials, except i used the .attachsound method instead of .loadsound on the slider movie clip. Anyone know why this happens? Thanks.

I havn’t seen the tutorials but when you declare the sound using .attachsound do you also use soundName.setVolume(100); to make it automatically 100% volume?

make a var controlling sounds volume and make it 100 :wink:

Yes, i tried that but it didn’t work. Here is my code on the first frame inside the slider movie clip:

this.ratio = 0;
dragger.onPress = function(){
this.startDrag(true,0,0,line._width,0);
this.onEnterFrame = function(){
ratio = Math.round(this._x*100/line._width) ;
_root.volume = ratio
}
}
dragger.onRelease = dragger.onReleaseOutside = stopDrag;

Here is my code on the slider movie clip:

onClipEvent(load){
song = new sound();
song.attachSound(“dn0021.aif”);
song.start(0, 10);
song.setVolume(100);
}
onClipEvent(enterFrame){
song.setVolume(_root.volume);
}

onClipEvent(load){
song = new sound();
song.attachSound("dn0021.aif");
song.start(0, 10);
_root.volume = 100;
}

??

great kax, that works. Thank you.

you’re welcome. :beam: :stuck_out_tongue: