About the onSoundComplete event

The onSoundComplete event of the ActionScript Sound object enables you to trigger an event in a Flash application based on the completion of an attached sound file. The Sound object is a built-in object that lets you control sounds in a Flash application. For more information, see Sound class. The onSoundComplete event of a Sound object is invoked automatically when the attached sound file finishes playing. If the sound is looped a finite number of times, the event is triggered when the sound finishes looping.

The Sound object has two properties that you can use in conjunction with the onSoundComplete event. The duration property is a read-only property representing the duration in milliseconds of the sound sample attached to the sound object. The position property is a read-only property representing the number of milliseconds the sound has been playing in each loop.

The onSoundComplete event enables you to manipulate sounds in a variety of powerful ways, such as the following: