반응형
ProgressBarTest.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Panel width="320" height="100" layout="absolute" horizontalCenter="0" verticalCenter="0" title="Progressbar Test">
<mx:ProgressBar indeterminate="false" horizontalCenter="-28" verticalCenter="0" labelPlacement="center" minimum="0" maximum="100" enabled="true" mode="manual" id="pb" themeColor="#66FF00" height="20" width="200"/>
<mx:Button label="click" id="b1" click="clicked()" width="50" height="20" verticalCenter="0" horizontalCenter="105"/>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
var i:uint;
var timerid:uint=0;
function increase():void{
pb.setProgress(i+=1, 100);
if(i==100){
mx.controls.Alert.show("완료");
clearInterval(timerid)
};
}
function clicked():void{
timerid=setInterval(increase,10);
}
]]>
</mx:Script>
</mx:Panel>
</mx:Application>
반응형