복권긁기

복권긁기 어색한 십자가 버전. ㅡ ㅡ;


onClipEvent (load) {
	this.id = Number(this._name.substr(3, 10));
	//현재 무비클립이 몇 번째 무비클립인지 판단하여
	//이를 id라는 변수에 저장
	this.upperItem = _root["box"+(Number(this.id)-_root.row)];
	//사각형이므로 현재 무비클립의 위에 있는 무비클립의 참조를 반환
	this.belowItem = _root["box"+(Number(this.id)+_root.row)];
	//사각형이므로 현재 무비클립의 아래에 있는 무비클립의 참조를 반환
	if (this.id%_root.row == 0) {
		this.leftItem = null;
	} else {
		this.leftItem = _root["box"+(Number(this.id)-1)];
	}
	if ((this.id+1)%_root.row == 0) {
		this.rightItem = null;
	} else {
		this.rightItem = _root["box"+(Number(this.id)+1)];
	}
	//무비클립이 좌우 가장자리에 있을 경우 null을 반환하고
	//그렇지 않을 경우 좌우측에 해당하는 무비클립에 대한 참조를 반환
}
onClipEvent (enterFrame) {
	if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
		tarA = 0;
		this._alpha = tarA-0.75*(tarA-this._alpha);
		this.upperItem._alpha = tarA-0.85*(tarA-this.upperItem._alpha);
		this.belowItem._alpha = tarA-0.85*(tarA-this.belowItem._alpha);
		this.rightItem._alpha = tarA-0.85*(tarA-this.rightItem._alpha);
		this.leftItem._alpha = tarA-0.85*(tarA-this.leftItem._alpha);
		if (this._alpha<=0) {
			this._visible = false;
		}
	}
	//마우스의 위치에 따라 상하좌우에 있는 무비클립의 _alpha를 감소시킴
}


About this entry