<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
    layout="absolute" backgroundColor="#FFFFFF"
    creationComplete="init()"  viewSourceURL="srcview/index.html">
    
    <mx:Style source="styles.css" />
    
    <mx:Script>
        <![CDATA[
            private var progress:Number = 300;
            
            private function init():void {
                var timer:Timer = new Timer(50);
                timer.addEventListener(TimerEvent.TIMER, updateProgress);

                updateProgress();
                timer.start();
            }
            
            private function updateProgress(event:TimerEvent = null):void {
                progress += 1;
                if(progress > 1000) progress = 0;
                
                pb_static.setProgress(progress, 1000);
                pb_moving.setProgress(progress, 1000);
            }            
        ]]>
    </mx:Script>
    
    
    <mx:VBox width="100%" height="100%" styleName="background" 
        horizontalAlign="center" verticalAlign="middle" verticalGap="15">
        
        <!-- Static Progress Bar -->
        <mx:ProgressBar id="pb_static" width="200" height="16" styleName="staticProgressBar" 
            mode="manual" labelPlacement="center" label="" />

        <!-- Moving Progress Bar -->
        <mx:ProgressBar id="pb_moving" width="200" height="16" styleName="movingProgressBar" 
            mode="manual" labelPlacement="center" label="" />

    </mx:VBox>
    
    
    
    <!-- Link -->
    <mx:LinkButton label="created by Tony Fendall" right="2" bottom="2" click="navigate()"/>
    <mx:Script>
        <![CDATA[
            import flash.net.navigateToURL;
            private function navigate():void
                { navigateToURL(new URLRequest("http://www.tonyfendall.com"),"_blank"); }
        ]]>
    </mx:Script>
</mx:Application>