Hi. I followed the tutorial for the volume control slider at:
http://www.kirupa.com/developer/mx/volume_slider.htm
I would like to know how I can set it so that the music starts
playing automatically without having to move the volume control
slider. I changed a part of it already so that the sound starts
automatically but the volume bar makes it so that I can’t hear
the music at all unless I move the slider up.
Is there a way to fix this?
Thanks for any help.
Here is the code on the slider mc:
onClipEvent (load) {
mySound = new Sound();
mySound.loadSound(“sound2.mp3”, true);
}
onClipEvent (enterFrame) {
downloaded = mySound.getBytesLoaded();
total = mySound.getBytesTotal();
if (downloaded != total) {
_root.dl = “downloading song…”;
} else {
complete = 1;
_root.dl = “”;
}
mySound.setVolume(_root.volume*2);
}
Here is the code inside the volume control bar:
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;
Thanks for any advice!