When a Sound Ends


You can use the duration and position of a sound to determine when a sound ends. They will be equal to each other. However, if a sound loops, the duration and position of a sound will be equal to each other for a moment at the end of each playback of the sound.

A better way to determine the end of a sound is to use the onSoundComplete listener.

This is a function triggered when the sound is finished playing.

Setting the Balance
You can also direct the sound more to one speaker than the other with the setPan command. This is similar to the balance control on a stereo.

You can set the pan of a sound to a value from -100 to 100. If you set it to -100, all sound comes from the left speaker. Setting it to 100 means that all sound comes from the right speaker.

Taken From: Sams Teach Yourself Flashâ„¢ MX ActionScript in 24 Hours

  1. No comments yet.
(will not be published)
  1. No trackbacks yet.
  • Partner links