2 Replies Latest reply on Apr 24, 2010 9:56 PM by penugonda

    HTML file loading in Adobe Air + ProgressBar?

    penugonda

      I am developing an AIR application. In that few reports I am showing. I am using HTML files to show the report.

      Action script is preparing/Writing the report contents into a file/

      I am using mx.controls.HTML to show the html file. Since the HTML file is little bigger in 512 MB RAM machine ( when I am running the air app)

      its taking 95%cpu when the page is getting rendered for a long time. Its making other applications unresponsive.

       

      Would it be possible to show progressbar when the HTML page is rendering?

       

      Regards

      Penugonda

        • 1. Re: HTML file loading in Adobe Air + ProgressBar?
          lite_As_AIR

          i created a similar thread a few weeks back http://forums.adobe.com/thread/619411?tstart=30. I was doing research on this topic for a quite long now but sadly there is no direct way of monitoring the progress of an html loader, it does not offer any progressEvent.Progress to monitor either. and what is more sad is that they haven't done anything about in the latest release of AIR either

           

          However all is not lost. What you can do is,monitor the progress of your URLRequest  using a URLLoader and once its complete you can use the (htmlloader object).loadString() function to render the html content loaded by the URLLoader :

           

          var browser:HTMLLoader = new HTMLLoader();
          var urlLoader:URLLoader = new URLLoader(new URLRequest("http://www.youtube.com/"));
          urlLoader.addEventListener(Event.COMPLETE, onUrlLoaderComplete);
          urlLoader.addEventListener(ProgressEvent.PROGRESS, onURLLoaderLoading);
                    
          private function onURLLoaderLoading(e:ProgressEvent):void 
          {
               trace("progress = ",Math.round((e.bytesLoaded/e.bytesTotal)*100));
          }
                    
          private function onUrlLoaderComplete(e:Event):void 
          {
               browser.loadString(e.target.data);
          }
                              
          

           

          cheers!

          • 2. Re: HTML file loading in Adobe Air + ProgressBar?
            penugonda Level 1

            Looks like I have presented the problem I am facing looks like different.

            I have the html file locally means in the same machine. The html file

            contains lot of images

            and huge content. When the html component is rendering the page its taking

            some time ,

            I want to see that when the complete page get loaded into the html component

            , I want to show a progressbar that time.

             

            If its not clear my doubt pl. let me know