6 Replies Latest reply on Nov 10, 2009 4:19 AM by uajmal

    Progress bar and HTTPService

    Freeseb
      I'm looking how to implement a progress bar that would follow the progress of HTTPServices requests (several insert SQL commands). Thanks
        • 1. Re: Progress bar and HTTPService
          romanczar
          Hi!
          I am interested in something similar.

          How can I show a progress bar like an alert windows instead f the busy cursor icon?
          • 2. Re: Progress bar and HTTPService
            leotemp Level 1
            You could use the indeterminate one, not much different from the showbusy cursor, but its a bit more in your face.
            • 3. Re: Progress bar and HTTPService
              romanczar Level 1
              What does the code for this look like?

              Is it possible at all to fade out e.g. the correpsonding datagrid and put some progress bar on top of it, like with the alert-messge effect?
              • 4. Re: Progress bar and HTTPService
                jopiruizen
                Yup, I guess HttpService doesn't handle any progress event.. If so , how... THanks
                • 5. Re: Progress bar and HTTPService
                  JeffreyGong
                  Hi all,

                  Try the following


                  =======================================================================
                  <?xml version="1.0" encoding="utf-8"?>
                  <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" creationComplete="init()">
                  <!-- main.mxml -->
                  <mx:Script>
                  <![CDATA[
                  import mx.managers.PopUpManager;

                  private var waitWin:ProgressWin;

                  private function init():void {
                  srv.send()
                  waitWin = new ProgressWin();
                  waitWin.title="Waiting ... "
                  PopUpManager.addPopUp(waitWin, this, true);
                  PopUpManager.centerPopUp(waitWin)
                  }

                  private function onResult(event:ResultEvent):void {
                  PopUpManager.removePopUp(waitWin);
                  out.text = "event.result = " + event.result
                  }
                  ]]>
                  </mx:Script>

                  <mx:HTTPService id="srv" url=" http://webserver/path/to/some.jsp" result="onResult(event)" />
                  <mx:TextArea id="out" width="400" height="300"/>

                  </mx:Application>

                  ------------------------------------------------------------------------------------------ --------
                  <?xml version="1.0" encoding="utf-8"?>
                  <!-- ProgressWin.mxml -->
                  <mx:TitleWindow xmlns:mx=" http://www.adobe.com/2006/mxml"
                  width="250" height="150" title="Progressive Window">

                  <mx:VBox horizontalAlign="center" >
                  <mx:Spacer height="5"/>
                  <mx:Label id="waitLbl" text="Data are loading" fontSize="14" textAlign="center" width="100%"/>
                  <mx:Spacer height="6"/>
                  <!-- loading.swf can be a Flash 8 animation -->
                  <mx:SWFLoader id="swfldr" source="assets/loading.swf"/>
                  </mx:VBox>

                  </mx:TitleWindow>
                  =========================================================

                  Jeffrey
                  • 6. Re: Progress bar and HTTPService
                    uajmal

                    What is ProgressWin? Is it a component or module? I am encountering following error while using the code.

                     

                    Type was not found or was not a compile-time constant: ProgressWin.

                     

                    I just created a new ProgressWin.mxml  file and pasted the code you posted but following error popped out


                    Could not resolve <mx:TitleWindow> to a component implementation.