상세 컨텐츠

본문 제목

5강. 부드러운 움직임을 이용, 마우스 포인터 만들기

Programming/ActionScript3.0

by 노란날. 2011. 1. 13. 22:19

본문

반응형



p0.addEventListener(Event.ENTER_FRAME, onEnter);
function onEnter(e:Event):void{
 p0.x = p0.x + (mouseX - p0.x)*0.1;
 p0.y = p0.y + (mouseY - p0.y)*0.1;
 
 for(var i:int=1; i<6;i++){
  this["p"+i].x = this["p"+i].x + (this["p"+(i-1)].x+10 - this["p"+i].x)*0.2;
  this["p"+i].y += (this["p"+(i-1)].y - this["p"+i].y)*0.2;
 }
}
반응형

'Programming > ActionScript3.0' 카테고리의 다른 글

6강. 1차함수 예제  (0) 2011.01.13
5강. 부드러운움직임을 이용한 예제  (0) 2011.01.13
5강. 네비게이션  (0) 2011.01.13
4강. 윈도우창 제어하기  (0) 2010.12.27
4강. for문을 이용한 도형맞추기  (0) 2010.12.27

관련글 더보기