MovieClip.onLoad
지원 버전
Flash Player 6
구문
my_mc.onLoad = function() {
// your statements here
}
매개 변수
없음
반환값
없음
설명
이벤트 핸들러; 무비 클립이 인스턴스화되어 타임라인에 표시될 때 호출됩니다. 해당 이벤트가 호출될 때 실행할 함수를 정의해야 합니다.
이 핸들러는 특정 클래스와 연관된 라이브러리에 심볼이 지정된 무비 클립에만 사용할 수 있습니다. 특정 무비 클립이 로드될 때(예: MovieClip.loadMovie()을 사용하여 SWF 파일을 동적으로 로드할 때) 호출되는 이벤트 핸들러를 원한다면 이 핸들러 대신 onClipEvent(load)를 사용해야 합니다. onClipEvent(load) 핸들러는 어떤 무비 클립이라도 로드될 때 호출됩니다.
예제
다음 예제는 MovieClip.onLoad()와 onClipEvent(load)의 올바른 사용법을 보여 줍니다.
// symbol_mc is a movie clip symbol in the library.
// It is linked to the MovieClip class.
// The following function is triggered for each instance of symbol_mc
// as it is instantiated and appears on the Timeline.
symbol_mc.onLoad = function() {
trace(“The movie clip is loaded”);
}
// dynamic_mc is a movie clip that is being loaded with MovieClip.loadMovie().
// This code attempts to call a function when the clip is loaded,
// but it will not work, because the loaded SWF is not a symbol
// in the library associated with the MovieClip class.
function output()
{
trace(“Will never be called.”);
}
dynamic_mc.onLoad = output;
dynamic_mc.loadMovie(“replacement.swf”);
// The following function is invoked for any movie clip that
// appears on the Timeline, whether it is in the library or not.
// Therefore, this function is invoked when symbol_mc is instantiated
// and also when replacement.swf is loaded.
OnClipEvent( load ) {
trace(“The movie clip is loaded”);
}
참고 사항
onClipEvent()
About this entry
You’re currently reading “MovieClip.onLoad,” an entry on multiplicité
- Published:
- Tuesday, July 20th, 2004 at 4:41 pm
- This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.0 Korea.
- Author:
- vizualizer
- Category:
- techne
No comments
Jump to comment form | comments rss