在Flex中使用进度条(ProgressBar)

以下例子展示Flex中如何使用进度条(ProgressBar)的简单例子
  
http://www.adobe.com/2006/mxml" creationComplete="init()">  
  
       
                    private var timer:Timer;
    
           private var j:uint=10;  
            
           private function init():void {
                 timer = new Timer(100);
                 timer.addEventListener(TimerEvent.TIMER, runit);
             }

           private function runit(evt:TimerEvent):void  
           {  
               if(j<=100)  
               {  
                 bar.setProgress(j,100);  
                 bar.label= "CurrentProgress" + " " + j + "%";  
                 j+=10;  
               }  
               if(j>100)  
               {  
                 timer.stop();
               }  
           }  
          
           private function startTimer():void {
               timer.start();
           }
          
         ]]>      
    
  
  
              paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">  
  
                      text="Click the button ." />  
           
              
                      minimum="0" visible="true" maximum="100" label="CurrentProgress 0%"    
             direction="right" mode="manual" width="100%"/>  
  
    
  
        

你可能感兴趣的:(Flex,flex,timer,application,function,button)