actionscript3.0

actionscriot 3.0 시계애미메이션 구현 [http://okgosu.net/zbxe/21095] 것퍼온것입니다.

멋진꿈 2011. 7. 25. 11:06

//혹시 저작권에 문제가있다면 댓글남겨주시면 지우도록하겠습니다.
package
{
 import flash.display.Sprite;
 import flash.events.Event;

 [SWF(width=800, height=480,backgroundColor=0x000000)]
 public class watchExam extends Sprite
 {
  private var needle:Sprite = new Sprite(); 
  public function watchExam()
  {
   this.drawWatch();
   needle.addEventListener(Event.ENTER_FRAME, function(event:Event):void
    {
     needle.rotation+=1;
    });
  }
  
  private function drawWatch():void {
   needle.graphics.beginFill(Math.random() * 0x1000000);
   needle.graphics.lineStyle(5, Math.random() * 0x1000000);           
   needle.graphics.drawCircle(0, 0, 210);
   needle.graphics.moveTo(0, 0); 
   needle.graphics.lineTo(0, -200);
   needle.x = stage.stageWidth/2;
   needle.y = stage.stageHeight/2;
   this.addChild(needle); 
  }
 }
 
 
}