dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Setting progress and the label of a progress bar

  1. #1
    Junior Member
    Join Date
    May 2005
    Location
    Minnesota
    Posts
    6

    Setting progress and the label of a progress bar

    Hey, I am trying to setup a basic progress bar that moves from 1 to 100%, and reflects that in a label too. However my label moves from 1 to 100 without reflecting any of the numbers in between.

    Code:
    private function runBar():void{
      setTimeout(moveBar, 2000);
    }
    private function moveBar():void{
      var i:int;
      for(i = 0; i <= 100; i++){
        progressBar.setProgress(i, 100);
        progressBar.label= "CurrentProgress" + " " + i + "%";
        trace(i);
      }
      runBar();
    }
    Last edited by EnjoyIncubus; 08-17-2008 at 10:24 PM.

  2. #2
    caithness massiv
    Join Date
    May 2000
    Location
    denver
    Posts
    1,672
    that's because you're executing inside a for loop...

  3. #3
    Junior Member
    Join Date
    May 2005
    Location
    Minnesota
    Posts
    6
    hmm...so is there any kind of sleep function that actionscript has that I could get this code to work? It would be nice to use a for loop to do this, since that seems to make the most sense to me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center