PDA

View Full Version : mute btn


i b o
29th July 2004, 16:32
I use the below script for my mute button. when i turn mute on, sound is off, but when i try to turn it off again, only the image changes and sound is still off...

???

MuteBtn.onLeftButtonUp(int x, int y) {
if (!Muted) { //If it isn't muted, mute it now
//gets current volume, then sets volume to 0
MuteBtn.setxmlparam("image","player.Mute.active");
VolumeLevel = System.getVolume();
System.setVolume(0);
Muted = 1;
} else { //unmute
//set volume to the value saved before
MuteBtn.setxmlparam("image","player.Mute.off");
System.setVolume(VolumeLevel);
Muted = 0;
}

leechbite
29th July 2004, 17:11
um try first replacing:

System.setVolume(VolumeLevel);

with:

System.setVolume(255);

see if it does change the volume. if it does, then the VolumeLevel variable is the problem.