'DEV_FLASH'에 해당되는 글 37건

  1. 2007.06.11 Method
  2. 2007.06.07 부드러운 움직임
  3. 2007.06.05 무비클립이벤트
  4. 2007.06.04 MovieClip
  5. 2007.06.01 Motion Tween

Method

DEV_FLASH 2007. 6. 11. 17:15 |

청소해(철수);

철수.청소해(); --> 이렇게 쓴다.

ex) _root.bird.play();


메서드의 선언- 무비클립에 관련된건 무조건 이렇게 써보자.

MovieClip.prototype.메서드명 = function(매개변수){


};


=======================================

메서드 선언문에 있는 this는 메서드를 호출한 무비클립을 가리킴...

MovieClip.prototype.moveX = function(dx){
 this._x=this._x +dx;
};


_root.bird.moveX(20);  //this 는 _root.bird 얘를 가르킴


부드러운 움직임이 필요할때는...

MovieClip.prototype.smoothMove = function(sp,tx,ty){
 this._x=this._x + sp*(tx-this._x);
 this._y=this._y + sp*(ty-this._y);
}

 


Posted by 으니가저아
:

부드러운 움직임

DEV_FLASH 2007. 6. 7. 17:14 |

오리와깃발사이의 거리 = targetX - this._x

this._x = this._x + 0.1*(targetX - this._x)



_root.bnUp.onPress = function(){
 _root.beetle._rotation=0;
 _root.beetle.onEnterFrame = function(){
  this._y = this._y -5;
 };
};

_root.bnRight.onPress = function(){
 _root.beetle._rotation = 90;
 _root.beetle.onenterFrame = function(){
  this._x = this._x+5;
 };
};
_root.onMouseUp = function(){
 _root.beetle.onEnterFrame = null;
};


//위의 경우 4번이면 4번다 써줘야 하지만, 아래를 이용하면 한번만 해주면 된다.

_root.bnRight.onRelease = function(){
 _root.beetle.onEnterFrame = null;
};

Posted by 으니가저아
:

무비클립이벤트

DEV_FLASH 2007. 6. 5. 17:12 |

onClipEvent(이벤트){

    액션들;

}

 

onClipEvent : 무비클립의 이벤트를 다루는 것..무비클립 이벤트 핸들러.

load : 처음 한번만 수행, 변수 선언은 load 이벤트에서 한다.

enterFrame : 매 프레임마다 수행

 

 

//이퀄라이저

onClipEvent(enterFrame){
      this._yscale = random(100);
}

 

버튼이나 프레임에서 this는 자신을 포함하고 있는 무비클립을 가르킨다.

 

좌표값 찾기

onClipEvent(enterFrame){
 _root.txtX = int(_root._xmouse);
 _root.txtY = int(_root._ymouse);
}

mouseMove 이벤트를 사용할 때, updateAfterEvent() 사용하면 무비가 부드러워진다.

 

거꾸로 재생되는 플래시 무비

onClipEvent(load){
 this._visible = false;
}

onClipEvent(enterFrame){
 if(_root.movie._currentFrame ==1){
  _root.movie.gotoAndStop(_root.movie._totalframes);
 }else{
  _root.movie.prevFrame();
 }
 
}


Posted by 으니가저아
:

MovieClip

DEV_FLASH 2007. 6. 4. 17:11 |

on(이벤트){

 

}

 

때 (집에오면){

  세수하기;

  밥먹기;

  잠자기;

}

 

on : 버튼 이벤트 핸들러...

 

onClipEvent(이벤트){

}


=====================================================================


주소 : 부모 무비클립의 경로명

이름 : 자기 자신의 이름

경로명 : 주소 + 이름


on(press){            //누르면
 _root.blue.stop();
}

on(release){          //떼면
 _root.blue.play();
}


=====================================================================


메서드(method):

무비 클립을 제어하는 수단(방법)

EX) stop(), play(), gotoAndStop(), gotoAndPlay(), nextFrame(), prevFrame()

gotoAndStop(20) //20번 프레임으로 가서 수행

                                    20.........전달하는 변수...매개변수


사용법 : 무비클립경로명.메서드

_root.bird.stop();

_root.bird.nextFrame();

play(), stop() : 무비 클립의 플레이 헤드를 정지, 재생하라 .


=====================================================================


무비클립의 속성(properties) -> 무비클립의 특징

ex) _x, _y, _width, _height, _xscale, _yscale, _alpha, _rotaiton, _visible,

_currentFrame, _totalFrames, _xmouse, _ymouse


사용법 : 무비클립 경로명.속성

_root.bird._x, _root.bird._width

오브젝트(물체) : 메서드(제어하는 수단....핸들,브레이크,엑셀), 속성(특징...높이,특징,색상)

왜 visible을 사용하는가?? alpha를 안쓰고..

Posted by 으니가저아
:

Motion Tween

DEV_FLASH 2007. 6. 1. 17:10 |

Motion Tween

Symbol  => F8

Key Frame => F6

Create Motion Tween


- 알파 값을 주면, CPU 에 부담을 줄 수가 있다.


- 그래픽 모션 회전시에 아래쪽 상단에 버튼 클릭


- 키 프레임 두개 잡아 놓고  속도 빠르고 늦게..부드럽게 값 설정

100이면 느려지고, -100이면 빠른거다.


- 동시에 두개를 같이 모션 줄 수 없으니, 레이어를 나눠서 작업한다.

Posted by 으니가저아
: