In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

netclock2

Get Adobe Flash player
by tipein123 03 Jan 2011
    Embed
/**
 * Copyright tipein123 ( http://wonderfl.net/user/tipein123 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/AKrT
 */

// forked from tipein123's forked from: forked from: netclock
// forked from tipein123's forked from: netclock
// forked from tipein123's netclock
// forked from tipein123's forked from: forked from: clocktest
// forked from tipein123's forked from: clocktest
// forked from tipein123's clocktest
package {
    import flash.display.Sprite;
    import flash.utils.*;
    import flash.events.TimerEvent;

    [SWF(width="170",height="170",backgroundColor="0xffffff",frameRate="60")]

    
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..


          var ticker: Timer;
          var _date:Date = new Date();

          var Rahmen:Sprite = new Sprite();
          var Rahmenrad:int = 80;
          var Sekundus:Sprite = new Sprite();
          var Sekundusrad:int = 6.75;
          var Minutus:Sprite = new Sprite();
          var Minutusrad:int = 12.5;
          var Horus:Sprite = new Sprite();
          var Horusrad:int = 25;
          var Anima:Sprite = new Sprite();
          var Animarad:int = Horusrad;
            
          Rahmen.graphics.lineStyle(1, 0x0000FF);
          Rahmen.graphics.drawCircle(0, 0, Rahmenrad);
          Rahmen.graphics.drawCircle(0, 0, Rahmenrad-2*Horusrad);
          Rahmen.x =85;
          Rahmen.y =85;
          addChild(Rahmen);
          
          
          Anima.graphics.lineStyle(0, 0x0000FF);
          Anima.graphics.drawCircle(0, 0 - Rahmenrad + Horusrad, Animarad);
          Anima.x = Rahmen.x;
          Anima.y = Rahmen.y;
          addChild(Anima);
          Anima.rotation =  360 / 720 * (60 * (_date.getHours() % 12) +  _date.getMinutes());
        
             
          Sekundus.graphics.lineStyle(1, 0xcccc00);
          Sekundus.graphics.drawCircle(0,  0, Sekundusrad);
          addChild(Sekundus);
            
          Minutus.graphics.lineStyle(1, 0x00FF00);
          Minutus.graphics.drawCircle(0, 0, Minutusrad);
          addChild(Minutus);
            
          Horus.graphics.lineStyle(1, 0xFF0000);
          Horus.graphics.drawCircle(0, 0, Horusrad);
          addChild(Horus);


            ticker = new Timer(100);
            ticker.addEventListener(TimerEvent.TIMER, rotateP);
            ticker.start();


function rotateP(event:TimerEvent):void {
    var _date:Date = new Date();
          /*
        Sekundus.rotation = 360 / 60 * _date.getSeconds();
        Minutus.rotation = 360 / 3600 * (_date.getMinutes() * 60 +  _date.getSeconds());
        Horus.rotation =  360 / 720 * (60 * (_date.getHours() % 12) +  _date.getMinutes());
          */
          
          Horus.x = Rahmen.x + Math.sin((180 - 360 / 720 * (60 * (_date.getHours() % 12) +  _date.getMinutes())) * Math.PI / 180)*(Rahmenrad-Horusrad);
          Horus.y = Rahmen.y + Math.cos((180 - 360 / 720 * (60 * (_date.getHours() % 12) +  _date.getMinutes())) * Math.PI / 180)*(Rahmenrad-Horusrad);

          Minutus.x = Horus.x + Math.sin((180 - 360 / 3600 * (_date.getMinutes() * 60 +  _date.getSeconds())) * Math.PI / 180)*(Horusrad-Minutusrad);
          Minutus.y = Horus.y + Math.cos((180 - 360 / 3600 * (_date.getMinutes() * 60 +  _date.getSeconds())) * Math.PI / 180)*(Horusrad-Minutusrad);

          Sekundus.x = Minutus.x + Math.sin((180 - 360 / 60 * _date.getSeconds()) * Math.PI / 180)*(Minutusrad-Sekundusrad);
          Sekundus.y = Minutus.y + Math.cos((180 - 360 / 60 * _date.getSeconds()) * Math.PI / 180)*(Minutusrad-Sekundusrad);

}            

            
    
        }
    }
}