Show the progress of an action script function

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default Show the progress of an action script function

    Sorry for my English :-(

    I have a very long action script function, updating a database, and I want to
    show their progress on screen with a component Progress Bar.

    I am using a Progress Bar in mode=manual and a function like this:

    private function longfunction() : void {
    <bla,bla, bla>
    pg.setProgress(10, 100);
    pg.label= "Loading 10%";
    <bla,bla, bla>
    pg.setProgress(50, 100);
    pg.label= "Loading 50%";
    <bla,bla, bla>
    pg.setProgress(100, 100);
    pg.label= "Loading 100%";
    }

    But the progress bar not refresh in screen until ends the function. ?Why? How
    I can force refresh screen in each progress?

    smontesa Guest

  2. Similar Questions and Discussions

    1. CF Grid / Java Script / Action Script
      Hi, Does anyone know of a good reference for the attributes CFgrid exposes in a flash form? eg. I would like to select the first row on load. ...
    2. Making progress, mp3 player script question
      Hello, again. Thank you all for your help. I am building an mp3 player, right now I have .mp3 files in a folder along with my Flash file. The...
    3. Need Help with action script.
      I am working on a project for one of my classes, and in it I want to be able to click on an apple (which is a button) and make it fall. I have tried...
    4. how to create a progress bar to control show
      I'm not even sure what to call what I want. But I'd like to build a slide show of photos with a progress bar that would indicate how far along the...
    5. Script Error: MPEG Progress Bar
      this is a known bug in director, dont worry, there's nothing wrong with your script. to remove the error, look here:...
  3. #2

    Default Re: Show the progress of an action script function

    You might try checking the mode of update defined for your progressBar. The
    default mode is Event and you are using Manual. You do not need to be
    concerned with your English. It is miles above my Spanish!

    javamonjoe Guest

  4. #3

    Default Re: Show the progress of an action script function

    The Flash Player is essentially single threaded. The UI will not update until
    the processing in the current frame is complete.

    The only way to work around this is to break the processing up into parts.
    Between the parts, use callLater() to allow the UI a chance to update.

    You can maintain a counter variable outside your function. Have your function
    start at the counter variable, and loop for some number of iterations(100?),
    update the counter, then call itself again, using callLater().

    Tracy

    ntsiii Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139