2 Replies Latest reply on Dec 20, 2006 11:55 PM by flexstudy

    Using loading bar again and again..

      1)I am loading large no of data in Flex application.
      2)Now since application was getting heavy I am only loading first 32 records at a time. (Just like paging ).
      3)When I apply filter on the ArrayCollection(full 1000+ records) which already I have. It returns me some 500 records. Now when filtering and arranging of the thumbnails is taking place, the panel looks blank. so I want to show the progressbar there.
      4)There I want to add loader or progressbar. I don't know how to do that.
      5)When I tried to show the panel in which I have added progressbar it simply doesn't show.
      Each time I want to show loading progress bar when I apply the filter.
      How can I do that ?

        • 1. Re: Using loading bar again and again..
          Level 1
          I use the progressbar for my file uploads. I simply add it to my mxml:

          <mx:FormItem label="Progress:" labelWidth="125" fontWeight="bold">
          <mx:ProgressBar id="progressBar" mode="manual" />

          The file upload process shoots off events that tell the progressbar what to display. The process starts with an open event, then with various progress events and ends with a complete event. The actionscript for the various events is show below:

          private function OpenEvent(event:Event):void {
          progressBar.setProgress(0, 100);
          progressBar.label = "Loading 0%";

          private function progressEvent(event:ProgressEvent):void {
          progressBar.setProgress(event.bytesLoaded, event.bytesTotal);

          private function completeEvent(event:Event):void {
          progressBar.label = "Complete.";

          I'm not sure if there is a way to monitor the process of your filter, but if there is, you can substitute the (event.bytesLoaded, event.bytesTotal) with (recordsFiltered, recordsTotal).

          I believe that is the gist of it.

          There is, as always, the handy, dandy language reference ( http://livedocs.macromedia.com/flex/2/langref/index.html) for that detailed info and even some more examples.


          • 2. Re: Using loading bar again and again..
            flexstudy Level 1
            Thanks will give try for this