How to Start and Stop Sounds


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. Start Sound
  2. var snd:Sound = new OldPhone(); // OldPhone is the name of the audio file in the library.
  3. var channel:SoundChannel;
  4. channel = snd.play()
  5.  
  6. Stop Sound
  7. channel.stop(); // stops playing whatever the sound is in that channel

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.