How to add sound clips onto buttons through Flash CS3 ActionScript 2.0?

  • Thread starter Thread starter Kaycee
  • Start date Start date
K

Kaycee

Guest
i am making a shooting game through flash cs3 and i want to have the sound make noise when you shoot the target and then goes onto the next ... how do i do that?

ive tired for ages and for some reason i doesnt work

please help
 
here is a quick and easy way to achive it.

var snd = new Sound();//create a varable to hold the new sound object
snd.attachSound("mysound"); //attaches the sound to the varible with the name mysound

myBtn_btn.onPress = function() { //assuming u have a btn or mc on the stage called myBtn_btn
snd.play();// play the sound
};

myBtn_btn.onRelease = function() { //assuming u have a btn or mc on the stage called myBtn_btn
snd.stop();// stop the sound
};
 
Back
Top