PDA

View Full Version : Moveclip Volume Up and Down Button



saveth
May 7th, 2005, 06:42 PM
Hi,

I'm trying to create a movieclip that on mouseDown will decrease the volume by one as long as it is pressed.

I currently have a global variable called volPercent set to 100 initially and I have two buttons with the following code.

volumeup_btn.onRelease = function() {
if (volPercent != 100) {
volPercent += 1;
volstatus = volPercent;
MySound.setVolume(volPercent);
}
};

volumedown_btn.onRelease = function() {
if (volPercent != 0) {
volPercent -= 1;
volstatus = volPercent;
MySound.setVolume(volPercent);
}
};

It works great but I need it to repeat the volume increase or decrease as long as it is pressed.

any help would be appreciated.

Thanks,
saveth

saveth
May 7th, 2005, 11:15 PM
Nevermind,

I figured it out and got everything working the way it should.
If anyone has the same problem and wants the code just ask and I'll drop it here.

Thanks,
saveth

scotty
May 8th, 2005, 02:43 AM
Nevermind,

I figured it out and got everything working the way it should.
If anyone has the same problem and wants the code just ask and I'll drop it here.

Thanks,
saveth
Can you do it? It might help viewers in the future:)

scotty(-: