PDA

View Full Version : Adding SFX to Adv Buttons



mindfriction
March 12th, 2004, 08:15 AM
Hey guys,

Ive been making some advanced buttons with some trendy transitions using Lostinbeta's onEnterFrame/ hitTest method below:



//this script is on my mc (which is the button)
onClipEvent(enterFrame){
if (this.hitTest(_root._xmouse, _root._ymouse, true)){
transition_mc.nextFrame();
} else {
transition_mc.prevFrame();
}
}


Can anyone tell me how to load an mp3 for the buttons sound effect?

This is what I have been doing (below), but it simply just doesn't work. The sound keeps on being played repeatedly whilst the mouse is over the button. I knew this would be the case but I just cant think of any other solutions..




onClipEvent(enterFrame){
if (this.hitTest(_root._xmouse, _root._ymouse, true)){
buttonSfx.start(0,0);
this.nextFrame();

} else {
this.prevFrame();
}
}
buttonSfx = new Sound(this);
buttonSfx.loadSound("SFX/click.mp3");


Thanks in advance! :smirk:

Voetsjoeba
March 12th, 2004, 01:45 PM
Maybe the code I posted in this thread can help: http://www.kirupaforum.com/forums/showthread.php?s=&threadid=48465

mindfriction
March 14th, 2004, 07:28 AM
Cool,

Thanks Voets, that will be handy, ill see what I can come up with :)