파도물결 /잡동사니

아날로그 시계 소스

맛간장 2018. 8. 10. 15:26

초침 연속돌기 아날로그 시계 소스  [1]


     onSelfEvent (enterFrame, includingFirstFrame) {

    time = new Date();

    mil = time.getMilliseconds();

    s = time.getSeconds();

    m = time.getMinutes();

    h = time.getHours();

    seconds._rotation = s*6+(mil/(1000/6));

    minutes._rotation = m*6+(s/10);

    hours._rotation = h*30+(m/2);

  }


초~ seconds

분~ minutes

시 ~ hours

clock







똑딱 똑딱 [2]

   onSelfEvent (enterFrame, includingFirstFrame) {

       myDate = new Date;


       hourhand._rotation = myDate.getHours()*30+myDate.getMinutes()/2;


       minutehand._rotation = myDate.getMinutes()*6+myDate.getSeconds()/10;


       secondhand._rotation = myDate.getSeconds() * 6;

    }



초~ secondhand

분~ minutehand

시~hourhand

hands




잘 두고 쓰자 잊어버리면 또 찾아 헤메인다.

메모장에서 삭제 하지 말아라.