Posted By

arpo on 12/30/08


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

THEPWN3R
davidino1978


Play sound basics


 / Published in: ActionScript 3
 

  1. import flash.media.Sound;
  2. import flash.media.SoundChannel;
  3.  
  4. somebutton.addEventListener(MouseEvent.CLICK,playSound);
  5.  
  6. var channel:SoundChannel;
  7. var snd:MySnd; //MySnd is the class name of the sound file in the library.
  8. snd = new MySnd();
  9.  
  10. function playSound(e:Event = null) {
  11. channel = snd.play();
  12. }

Report this snippet  

You need to login to post a comment.