0 Replies Latest reply on Aug 12, 2013 3:05 AM by ab191

    ProgressBar reset Issue

    ab191

      I have been working on resetting a progressBar in flex, but the thing is that progressbar correctly displays the bytes loaded while the file is downloaded for the first time, but for other consecutive file downloads, it just stays at 100% although the file is downloaded, How do I reset the the progressbar so that it correctly shows the progress for other files too.

       

       

      I have tried using pb.setProgress(0,100) before the progressbar starts to set the progress to zero but it also does not helps.

       

       

      Also I have set the mode to manual.

       

       

      Ok here is what I have done :

       

       

      Have a progress Event in which I am setting the progress of the progressBar as :

       

       

      public function progressHandler(event:ProgressEvent):void
                  {                               
                      pb.width=300;
                      pb.height=30;
                      pb.labelPlacement="center";
                      pb.mode="manual";
                      pb.setProgress(event.bytesLoaded, event.bytesTotal);    
                  }
      

       

       

       

      Also in the open event I am calling a title window and adding the progress bar into it and then popping it using the popup manager as :

       

       

      public function openWindow(event:Event):void {
                      tWin.title = "Please Wait";
                      tWin.width=400;
                      tWin.height=100;
                      tWin.addChild(pb);
                      PopUpManager.addPopUp(tWin, this, true,PopUpManagerChildList.POPUP);
                      PopUpManager.bringToFront(tWin);
                      PopUpManager.centerPopUp(tWin); 
      
                  }

       

       

      Then finally in the complete event, i am removing the popupmanager and setting the progress to be zero as :

       

      public function completeHandler(evt:Event):void {
      PopUpManager.removePopUp(tWin);
      pb.setProgress(0,100);
      }
      

       

      But still the progress bar remains at 100% for any consecutive file downloads. Any help..??