Okay so I searched on the internet on how to play a sound when a key is pressed and I came across this:
Hey,
first up, for all the seperate sounds you are going to use it needs to have a unique linkage to actionscript. Right click on a sound in your library and click linkage, now give it a unique and logical name and click Export for actionscript check box aswell. Do this for all of them.
Now, make a button. on (keyPress "c") {
New-name-here = new Sound();
New-name-here.attachSound("cannon");
_root.New-name-here.start();
}
Add that code. Now the word cannon is the unique name you gave the sound , change it to what sound you want to play. The c up top is the letter that needs to be pressed to hear the sound. And finally
New-name-here needs to be changed to a more suitable holder for that sound, in this case maybe 'cannonholder'
What does that mean? If it helps I am making a drum I named the linkage kick and the sound that I want to play is named tight_kick_017
Tags: