<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">
<mx:Script>
<![CDATA[
import mx.events.SliderEvent;
private var timer:Timer=new Timer(1000);
private function init():void
{
var c:Class=progressBar.getStyle("indeterminateSkin");
progressBar.setStyle("barSkin", c);
progressBar.setProgress(100, 100);
timer.addEventListener(TimerEvent.TIMER, progressBar_change);
timer.start();
}
private function progressBar_change(event:TimerEvent):void
{
progressBar.setProgress(progressBar.value - 1, 100);
if (progressBar.value == 0)
{
timer.stop();
}
}
]]>
</mx:Script>
<mx:ProgressBar id="progressBar"
mode="manual"
barColor="#9932CC"
labelPlacement="center"
height="30"
creationComplete="init();"
width="658"/>
</mx:Application>