T > this

 

this

지원 버전

Flash Player 5

구문

this

설명

키워드; 객체 또는 무비 클립 인스턴스를 참조합니다. 스크립트가 실행되면 this는 스크립트를 포함한 무비 클립 인스턴스를 참조합니다. 메서드가 호출되면 this는 호출된 메서드를 포함한 객체에 대한 참조를 포함합니다.

단추에 첨부된 on 이벤트 핸들러 액션 안에서 this는 해당 단추를 포함하는 타임라인을 참조합니다. 무비 클립에 첨부된 onClipEvent 이벤트 핸들러 액션 안에서 this는 무비 클립의 타임라인을 참조합니다.

예제

다음 예제에서 키워드 this는 Circle 객체를 참조합니다.

function Circle(radius) {
	this.radius = radius;
	this.area = Math.PI * radius * radius;
}

프레임에 지정된 다음 명령문에서 키워드 this는 현재 무비 클립을 참조합니다.

// sets the alpha property of the current movie clip to 20
this._alpha = 20;

onClipEvent 핸들러 안에 있는 다음 명령문에서 키워드 this는 현재 무비 클립을 참조합니다.

// when the movie clip loads, a startDrag operation
// is initiated for the current movie clip.

onClipEvent (load) {
	startDrag (this, true);
}

참고 항목

new