View comments | RSS feed

onSoundComplete (Sound.onSoundComplete handler)

onSoundComplete = function() {}

Invoked automatically when a sound finishes playing. You can use this handler to trigger events in a SWF file when a sound finishes playing.

You must create a function that executes when this handler is invoked. You can use either an anonymous function or a named function.

Availability: ActionScript 1.0; Flash Player 6

Example

Usage 1: The following example uses an anonymous function:

var my_sound:Sound = new Sound();
my_sound.attachSound("mySoundID");
my_sound.onSoundComplete = function() {
trace("mySoundID completed");
};
my_sound.start();

Usage 2: The following example uses a named function:

function callback1() {
trace("mySoundID completed");
}
var my_sound:Sound = new Sound();
my_sound.attachSound("mySoundID");
my_sound.onSoundComplete = callback1;
my_sound.start();

See also

onLoad (Sound.onLoad handler)


Flash CS3


Comments


No screen name said on Jul 16, 2008 at 1:35 AM :
for sound mySound_snd onComplete is not called when mySound_snd.stop() is called.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00002138.html