Link:INB Home|INB English| INB русский язык|INB العربية|INB Türkiye|INB فارسی|INB Español|INB Français|INB Português|INB Deutsch|INB 國語|INB 中文|INB 日本语|INB 한국어|INB ภาษาไทย|INB tiếng Việt||자습서 플래시Flash 강좌,[플래시][엑션스크립트] Useful Action Library
INB 한국어 포럼
(산업 및 기본 과학자)에 오신 것을 환영합니다 여기에 산업 시대는 원시 생물 정신 과학자와이 네트워크 공간을 통해 당신과 내가 둘 다 미친 실험실에 온, 투지로 가득하다. 홈 INBforum.com, 영구 이름 :twtmo.forums2u.com
INB 한국어 포럼
(산업 및 기본 과학자)에 오신 것을 환영합니다 여기에 산업 시대는 원시 생물 정신 과학자와이 네트워크 공간을 통해 당신과 내가 둘 다 미친 실험실에 온, 투지로 가득하다. 홈 INBforum.com, 영구 이름 :twtmo.forums2u.com
INB 한국어 포럼

(산업 및 기본 과학자)에 오신 것을 환영합니다 여기에 산업 시대는 원시 생물 정신 과학자와이 네트워크 공간을 통해 당신과 내가 둘 다 미친 실험실에 온, 투지로 가득하다. 홈 INBforum.com, 영구 이름 :twtmo.forums2u.com


You are not connected. Please login or register

《《《《《《《上一页INBforum   Go down

上一页INBforum》》》》》》》이전 주제 보기 다음 주제 보기 Go down  메시지 [페이지 11]

1자습서 플래시Flash 강좌,[플래시][엑션스크립트] Useful Action Library Empty 자습서 플래시Flash 강좌,[플래시][엑션스크립트] Useful Action Library Tue May 24, 2011 7:58 am

Admin


Admin
Useful Action Library



3D Method
----------------------------------------------------------------------------------------
// 사라지게함
this._visible = false;
// x 축 회전 메서드
MovieClip.prototype.rotateX = function(t, cy, cz) {
var tempy = cy + (this.y-cy)*Math.cos(t)-(this.z-cz)*Math.sin(t);
this.z = cz + (this.y-cy)*Math.sin(t)+(this.z-cz)*Math.cos(t);
this.y = tempy;
};
// y 축 회전 메서드
MovieClip.prototype.rotateY = function(t, cz, cx) {
var tempz = cz + (this.z-cz)*Math.cos(t)-(this.x-cx)*Math.sin(t);
this.x = cx + (this.z-cz)*Math.sin(t)+(this.x-cx)*Math.cos(t);
this.z = tempz;
};
// z 축 회전 메서드
MovieClip.prototype.rotateZ = function(t, cx, cy) {
var tempx = cx + (this.x-cx)*Math.cos(t)-(this.y-cy)*Math.sin(t);
this.y = cy + (this.x-cx)*Math.sin(t)+(this.y-cy)*Math.cos(t);
this.x = tempx;
};
// 3d 원근 표시 메서드
MovieClip.prototype.plot3d = function(f, viewPoint) {
// z좌표가 -f 보다 작으면 무비클립이 보이지 않게 함
if(this.z<-f){
this._visible = false;
}else{
this._visible = true;
// z값에 따른 scale 값을 구함
var scale = f/(f+this.z);
this._yscale = this._xscale = this._alpha = scale*100;
// 회전한 좌표를 무비클립 속성으로 설정
this._x = this.x*scale;
this._y = this.y*scale - viewPoint*this.z;
// z값에 따른 depths 설정
this.swapDepths(50000000 - 100*this.z);
}
};
----------------------------------------------------------------------------------------

connectMC
----------------------------------------------------------------------------------------
// 사라지게함
this._visible = false;
// 두 무비클립을 연결하는 라인을 만드는 메서드
// width = height = 100 이고, 좌상단 기준점에서 우하단으로 그려진 hairline 두께의 직선 무비클립(line)이 필요
MovieClip.prototype.connectMc = function(mc1, mc2){
this._x = mc1._x;
this._y = mc1._y;
this._xscale = mc2._x - mc1._x;
this._yscale = mc2._y - mc1._y;
};
----------------------------------------------------------------------------------------

drawLine
----------------------------------------------------------------------------------------
// 사라지게함
this._visible = false;
// 두 점을 연결하는 라인을 만드는 메서드
// width = height = 100 이고, 좌상단 기준점에서 우하단으로 그려진 hairline 두께의 직선 무비클립(line)이 필요
MovieClip.prototype.drawLine = function(x1, y1, x2, y2){
this._x = x1;
this._y = y1;
this._xscale = x2 - x1;
this._yscale = y2 - y1;
};
----------------------------------------------------------------------------------------

elasticMove
----------------------------------------------------------------------------------------
// 사라지게함
this._visible = false;
// 무비클립 탄력적인 움직임 메서드
// a는 -2부터 2사이의 실수 (-2<a<2) a가 -2에 가까울수록(작을수록) 속도가 빠름
// b는 -1부터 0사이의 실수(-1<b<0) b가 -1에 가까울수록 진동폭이 큼
// 적당한 값 : a=1.85 b=-0.9 (36fps)
// tx와 ty는 이동할 최종 위치
MovieClip.prototype.elasticMove = function(a, b, tx, ty){
var tempx = this._x;
var tempy = this._y;
this._x = a*(this._x - tx) + b*(this.prevx - tx) + tx;
this._y = a*(this._y - ty) + b*(this.prevy - ty) + ty;
this.prevx = tempx;
this.prevy = tempy;
};
----------------------------------------------------------------------------------------

elasticScale
----------------------------------------------------------------------------------------
// 사라지게함
this._visible = false;
// 무비클립 탄력적인 % 크기변환 메서드
// a는 -2부터 2사이의 실수 (-2<a<2) a가 -2에 가까울수록(작을수록) 속도가 빠름
// b는 -1부터 0사이의 실수(-1<b<0) b가 -1에 가까울수록 진동폭이 큼
// 적당한 값 : a=1.85 b=-0.9 (36fps)
// txscale와 tyscale는 변화할 최종 크기
MovieClip.prototype.elasticScale = function(a, b, txscale, tyscale){
var tempxscale = this._xscale;
var tempyscale = this._yscale;
this._xscale = a*(this._xscale - txscale) + b*(this.prevxscale - txscale) + txscale;
this._yscale = a*(this._yscale - tyscale) + b*(this.prevyscale - tyscale) + tyscale;
this.prevxscale = tempxscale;
this.prevyscale = tempyscale;
};
----------------------------------------------------------------------------------------

elasticSize
----------------------------------------------------------------------------------------
// 사라지게함
this._visible = false;
// 무비클립 탄력적인 px 크기변환 메서드
// a는 -2부터 2사이의 실수 (-2<a<2) a가 -2에 가까울수록(작을수록) 속도가 빠름
// b는 -1부터 0사이의 실수(-1<b<0) b가 -1에 가까울수록 진동폭이 큼
// 적당한 값 : a=1.85 b=-0.9 (36fps)
// tw와 th는 변화할 최종 픽셀 크기
MovieClip.prototype.elasticSize = function(a, b, tw, th) {
this.tempw = this._width;
this.temph = this._height;
this._width = a*(this._width-tw)+b*(this.prevw-tw)+tw;
this._height = a*(this._height-th)+b*(this.prevh-th)+th;
this.prevw = this.tempw;
this.prevh = this.temph;
};
----------------------------------------------------------------------------------------

rotateTo
----------------------------------------------------------------------------------------
// 사라지게함
this._visible = false;
// (targetX, targetY)를 바라보는 메서드.
// 마우스 커서를 바라보는 액션, this.rotateTo(_root._xmouse, _root._ymouse)
MovieClip.prototype.rotateTo = function(targetX, targetY) {
var diffX = targetX - this._x;
var diffY = targetY - this._y;
this._rotation = Math.atan2(diffY, diffX)*180/Math.PI;
};
----------------------------------------------------------------------------------------

setColor
----------------------------------------------------------------------------------------
// 사라지게함
this._visible = false;
// 무비클립에 색을 칠하는 메서드
MovieClip.prototype.setColor = function(c) {
// c 는 #000000 형태의 16진수
myColor = new Color(this);
myColor.setRGB(c);
};
----------------------------------------------------------------------------------------

smoothMove
----------------------------------------------------------------------------------------
// 사라지게함
this._visible = false;
// 무비클립 부드러운 움직임 메서드
// 0<speed<1 사이의 실수. 1에 가까울수록(클수록) 속도가 빠름
// 적당한 값 : speed = 0.1 (36fps)
// tx와 ty는 이동할 최종 위치
MovieClip.prototype.smoothMove = function(speed, tx, ty) {
this._x += speed*(tx - this._x);
this._y += speed*(ty - this._y);
};
----------------------------------------------------------------------------------------

smoothScale
----------------------------------------------------------------------------------------
// 사라지게함
this._visible = false;
// 무비클립 부드러운 % 크기 변환 메서드
// 0<speed<1 사이의 실수. 1에 가까울수록(클수록) 속도가 빠름
// 적당한 값 : speed = 0.1 (36fps)
// txscale와 tyscale는 변화할 최종 크기
MovieClip.prototype.smoothScale = function(speed, txscale, tyscale) {
this._xscale += speed*(txscale-this._xscale);
this._yscale += speed*(tyscale-this._yscale);
};
----------------------------------------------------------------------------------------

smoothSize
----------------------------------------------------------------------------------------
// 사라지게함
this._visible = false;
// 무비클립 부드러운 px 크기 변환 메서드
// 0<speed<1 사이의 실수. 1에 가까울수록(클수록) 속도가 빠름
// 적당한 값 : speed = 0.1 (36fps)
// tw와 th는 변화할 최종 픽셀 크기
MovieClip.prototype.smoothSize = function(speed, tw, th) {
this._width += speed*(tw-this._width);
this._height += speed*(th-this._height);
};
----------------------------------------------------------------------------------------

distance
----------------------------------------------------------------------------------------
// 사라지게함
this._visible = false;
// 두 점사이의 거리를 구하는 함수
_global.distance = function(x1, y1, x2, y2){
var diffX = x1 - x2;
var diffY = y1 - y2;
return Math.sqrt(diffX*diffX + diffY*diffY);
}
----------------------------------------------------------------------------------------






[You must be registered and logged in to see this image.]
http://www.mbc-academy.co.kr]

http://kr.inbforum.com

上一页INBforum   Go down

上一页INBforum이전 주제 보기 다음 주제 보기 위로  메시지 [페이지 11]

Permissions in this forum:
답글을 올릴 수 없습니다

Copyright ©2009-2010 LTD Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

IT:SINGLESERVGoogle谷歌翻译TranslateFORUMSOFTLAYERGoogle谷歌广告联盟AdSenseAsia

 

Create a forum on Forumotion | ©phpBB | Free forum support | 악용 사례 신고 | Latest discussions