This is a similar question to another post i just replied..
Im going to reply to all code examples point people to start
putting instance names on objects like movieclips and buttons(you achieve this in the property inspector)
and then put the relavant code on the time line of the clip holding your objects..
so name your button "mybutt_btn" in the property inspector in the instancename input fieldbox
leave the sound in the library and right click , select linkage, and give it a linkage identifier,
what ever you want like "mysnd" -- without the quotes
then set up a sound object on the timeline of the holding clip:
var mysound:Sound = new Sound();
mysound.attachSound("mysnd");
mybutt_btn.onRelease = function(){
// call stop sothat it doesnt play two instances of the sound over each other
mysound.stop();
mysound.start();
};
now when ever you click the button the sound will play;
this stucture is more dynamic as you can create a sound object on any timeline you wish, with the same code as above
and get it to play :)