PDA

View Full Version : Possible to add sound on mouse click?



Shotgun Facelift
September 19th, 2001, 09:51 AM
Hello,
What I have is a mouse cursor as a crosshair, and when I click I want it to play a gunshot sound. What I did was make the background a button and attached the sound.

So what I want to do is avoid making the background a button, can I attach the sound so it plays when I left click the mouse?

Thanks all.

Bye....

upuaut8
September 19th, 2001, 10:06 AM
Put the sound in the "down" state of the button. That's the button's third frame. It will play every time the button is pressed.

thoriphes
September 19th, 2001, 11:40 AM
or, what you could do to eliminate the whole backg button is to make a blank MC, put it on the main stage, and give it this sorta actionscript:

onClipEvent(load) {
snd = new Sound();
snd.attachSound("sound name");
}
onClipEvent(mouseDown) {
snd.start();
}

upuaut8
September 21st, 2001, 06:37 AM
You know.. I need to read more about the sound object. I really don't understand more than the basics of that. Can you start a thread in Action Script forum and give what ever details you have on it?