S > Sound.onSoundComplete

 

Sound.onSoundComplete

지원 버전

Flash Player 6

구문

mySoundObject.onSoundComplete = callbackFunction

매개 변수

mySoundObject Sound 객체입니다.

callbackFunction 함수입니다.

반환값

없음

설명

이벤트; 사운드가 재생을 마치면 자동으로 호출됩니다. onSoundComplete 이벤트를 사용하여 사운드가 완료되면 무비에서 이벤트를 트리거할 수 있습니다.

onSoundComplete 이벤트가 호출될 때 실행하는 함수를 만들어야 합니다. 익명의 함수 또는 이름이 있는 함수를 사용할 수 있습니다.

예제

구문 1: 다음 예제에서는 익명의 함수를 사용합니다.

s = new Sound();
s.attachSound("mySound");
s.onSoundComplete = function() { trace("mySound completed"); };
s.start();

구문 2: 다음 예제에서는 이름이 있는 함수를 사용합니다.

function callback1() {
trace("mySound completed");
}

s = new Sound();
s.attachSound("mySound");

s.onSoundComplete = callback1;

s.start();