<?xml version="1.0" encoding="utf-8"?>
<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:Degrafa="http://www.degrafa.com/2007"
    layout="absolute"
    creationComplete="initTime()" viewSourceURL="srcview/index.html">
    
    <mx:Script>
        <![CDATA[
                        
            private var clocktick:Timer= new Timer(1000);
            
            public function initTime():void
            {    
                setTime(new Date());
                clocktick.addEventListener(TimerEvent.TIMER, initDraw);
                clocktick.start();

                
            }
            
            private function initDraw(event:TimerEvent):void
            {
                setTime(new Date());    
            }
            

            public function setTime(currtime:Date):void 
            {
                var currseconds:uint = currtime.getSeconds();
                var currminutes:uint = currtime.getMinutes();
                var currhours:uint = currtime.getHours();

                secondHand.rotation = 268 + (currseconds * 6);
                minuteHand.rotation = 268 + (currminutes * 6);
        
                hourHand.rotation = 268 + (currhours * 30) + (currminutes * 0.5);
            }
            
        ]]>
    </mx:Script>
    
    <Degrafa:Surface
        x="100"
        y="100">
    
        <Degrafa:fills>
            <Degrafa:RadialGradientFill
                id="greyRadFill"
                cx="40"
                cy="20"
                radius="440">
                <Degrafa:GradientStop
                    color="#444"/>
                <Degrafa:GradientStop
                    color="#000"/>
            </Degrafa:RadialGradientFill>
            <Degrafa:SolidFill
                id="whiteFill"
                color="#FFF"/>
        </Degrafa:fills>
        
        <Degrafa:strokes>
            <Degrafa:SolidStroke
                id="redStroke"
                color="#C50"
                weight="10"
                caps="none"/>
            <Degrafa:SolidStroke
                id="greyStroke"
                color="#666"
                weight="2"
                caps="none"/>
        </Degrafa:strokes>
    
        <!-- The Clock Face -->
        <Degrafa:GeometryGroup
            id="clockFace">
            
            <!-- The Grey Background Rectangle -->
            <Degrafa:RegularRectangle
                width="360"
                height="360"
                fill="{ greyRadFill }"/>
                
            <!-- The White "F" Polygon -->
            <Degrafa:Polygon
                x="74"
                y="90"
                fill="{ whiteFill }">
                <Degrafa:points>
                    <Degrafa:GraphicPoint
                        x="1.716"
                        y=".868"/>
                    <Degrafa:GraphicPoint
                        x="91.638"
                        y=".868"/>
                    <Degrafa:GraphicPoint
                        x="92.329"
                        y="21.965"/>
                    <Degrafa:GraphicPoint
                        x="30.768"
                        y="21.965"/>
                    <Degrafa:GraphicPoint
                        x="30.768"
                        y="71.768"/>
                    <Degrafa:GraphicPoint
                        x="85.758"
                        y="71.768"/>
                    <Degrafa:GraphicPoint
                        x="85.758"
                        y="95.632"/>
                    <Degrafa:GraphicPoint
                        x="30.768"
                        y="95.632"/>
                    <Degrafa:GraphicPoint
                        x="30.768"
                        y="164.11"/>
                    <Degrafa:GraphicPoint
                        x="1.37"
                        y="164.11"/>
                </Degrafa:points>
            </Degrafa:Polygon>
            
            <!-- The White "x" Polygon -->
            <Degrafa:Polygon
                x="178"
                y="140"
                fill="{ whiteFill }">
                <Degrafa:points>
                    <Degrafa:GraphicPoint
                        x="1.107"
                        y=".147"/>
                    <Degrafa:GraphicPoint
                        x="32.926"
                        y=".147"/>
                    <Degrafa:GraphicPoint
                        x="54.022"
                        y="39.574"/>
                    <Degrafa:GraphicPoint
                        x="76.503"
                        y=".147"/>
                    <Degrafa:GraphicPoint
                        x="105.209"
                        y=".147"/>
                    <Degrafa:GraphicPoint
                        x="72.354"
                        y="54.446"/>
                    <Degrafa:GraphicPoint
                        x="108.322"
                        y="113.932"/>
                    <Degrafa:GraphicPoint
                        x="73.736"
                        y="113.932"/>
                    <Degrafa:GraphicPoint
                        x="52.256"
                        y="73.43"/>
                    <Degrafa:GraphicPoint
                        x="32.505"
                        y="113.241"/>
                    <Degrafa:GraphicPoint
                        x=".07"
                        y="113.241"/>
                    <Degrafa:GraphicPoint
                        x="34.31"
                        y="58.596"/>    
                </Degrafa:points>
            </Degrafa:Polygon>
            
        </Degrafa:GeometryGroup>
        
        <!-- The Second Hand -->
        <Degrafa:GeometryGroup
            id="secondHand"
            x="180"
            y="180">
            <Degrafa:HorizontalLine
                x="0"
                x1="160"
                y="0"
                stroke="{ greyStroke }"/>
        </Degrafa:GeometryGroup>
        
    <!-- The Minute Hand -->
    <Degrafa:GeometryGroup
        id="minuteHand"
        x="180"
        y="180">
        <Degrafa:HorizontalLine
            x="0"
            x1="150"
            y="0"
            stroke="{ redStroke }"/>
    </Degrafa:GeometryGroup>
    
    <!-- The Hour Hand -->
    <Degrafa:GeometryGroup
        id="hourHand"
        x="180"
        y="180">
        <Degrafa:HorizontalLine
            x="0"
            x1="100"
            y="0"
            stroke="{ redStroke }"/>
    </Degrafa:GeometryGroup>
        
    </Degrafa:Surface>
    
</mx:Application>