4 Replies Latest reply on Jan 8, 2009 10:17 AM by Bogdan_V_Mata

    Cursor getting locked problem

    kittuokkade Level 1
      hai all,
      i had a problem with cursor.iam invoking a webservice from flex client .for that i set busy cursor and timer cursor is showing up till my server returns the content after receiving i have some action script
      code executing to display in my required format.But the cursor that is revolving nature gets locked when the actionscript code is executing .how can i eliminate this behavior .i want the timer to revolve till the data displayed in the client.
      Any body has any idea.pls give suggestion
        • 1. Re: Cursor getting locked problem
          dietmar.paulus Level 1
          This is because your request gets encoded and this process will consume the whole cpu-power. another thing is that action script is not multithreating. we had the same problem. what we did, was to write an own encoder, and during the encoding-phase we made some "sleep phase" so that the user-interface (and also your cursor) cans update. But it is not easy to write such a code, because this will look different for ever encoder

          btw: we also did this for the decoders
          • 2. Re: Cursor getting locked problem
            kittuokkade Level 1
            hai paulus,
            your explanation seems to be correct.The thing is during execution of actionscript cursor timer getting locked.i had UI in which deals with graphical images, action script takes some time .user can notice this behavior.eliminating this is important .you said that you already did it.can u tell me is there any useful links to show me the way.
            • 3. Re: Cursor getting locked problem
              kittuokkade Level 1
              still i had no solution .any body can show me the way.
              • 4. Re: Cursor getting locked problem
                Bogdan_V_Mata
                I have some very consuming GUI operations, adding some objects to a list (advanced data grid). I've used something like that in the code:

                quote:


                private function addButtonClick(event : MouseEvent) : void {
                CursorManager.setBusyCursor();
                var timer : Timer = new Timer(500, 1);
                timer.addEventListener(TimerEvent.TIMER, onAddTimer);
                timer.start();
                }

                private function onAddTimer(event : TimerEvent) : void {
                // the consuming operation
                var selectable : ISelectable = this.allRegisterPanel.getChildAt(0) as ISelectable;
                this.allRegisterDataGrid.add(selectable.selectedItemsArray);
                // end of the operation
                CursorManager.removeBusyCursor();
                }



                Maybe this will help you.
                Anyway the GUI thread is block during those operation, so the mouse pointer freeze.
                If this is not an issue, you can use the code i've posted.

                Best regards.