Onsoundcomplete (Sound.onsoundcomplete Handler); Position (Sound.position Property) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

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 Lite 2.0
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)

position (Sound.position property)

public position :
Number
[read-only]
The number of milliseconds a sound has been playing. If the sound is looped, the position is
reset to 0 at the beginning of each loop.
Note: Flash Lite 2.0 supports this property for native Flash sound only. The sound formats
that are specific to a host device are not supported.
Availability: ActionScript 1.0; Flash Lite 2.0
612
ActionScript classes

Advertisement

Table of Contents
loading

Table of Contents