0 Replies Latest reply on May 15, 2008 10:58 PM by FlexyBoy

    Busy cursor on swf remains turning

    FlexyBoy
      Hello,

      Am having a problem. I developed a simple application on flex 2 and it communicates with Coldfusion .cfc file.
      Pleaes find the codes for my application and my cfc below.

      When I click the button, it does everything that the cfc says...for example inserting records in a table etc. However the cursor remains still busy after all the actions have been performed, and the memory usage of my cpu peaks during this moment.

      Here is my flex mxml code :

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">


      <mx:Script>
      <![CDATA[
      import mx.formatters.DateFormatter;
      import mx.controls.dataGridClasses.DataGridColumn;
      import mx.controls.dataGridClasses.DataGridListData;
      import mx.events.DragEvent;
      import mx.collections.*;
      import mx.collections.ArrayCollection;
      import mx.rpc.events.ResultEvent;
      import mx.controls.Alert;
      import mx.events.CloseEvent;
      import flash.events.Event;
      import mx.containers.*;
      import mx.controls.List;
      import flash.events.Event;
      import flash.events.MouseEvent;
      import mx.events.ListEvent;
      import flash.display.DisplayObject;
      import mx.managers.PopUpManager;
      import mx.utils.StringUtil;
      import flash.utils.Timer;

      import flash.events.Event;
      import mx.containers.TitleWindow;
      import mx.containers.Panel;
      import flash.geom.Point;
      import flash.net.*;
      import mx.core.IFlexDisplayObject;
      import mx.core.DragSource;
      import mx.managers.DragManager;
      import mx.events.DragEvent;
      import mx.collections.IList;
      import mx.controls.DataGrid;
      import mx.containers.Grid;
      import mx.managers.CursorManager;

      public function BtnHandler():void{
      myService.myfnc();
      }



      ]]>
      </mx:Script>


      <mx:RemoteObject id="myService" destination="ColdFusion" source="components.mycfc" showBusyCursor="true" fault="Alert.show(event.fault.message,'Error')">
      <mx:method name="myfnc" fault="Alert.show(event.fault.message)"/>
      </mx:RemoteObject>


      <mx:Button x="264" y="122" label="Button" click="{BtnHandler();}"/>

      </mx:Application>




      And here is my cfc code :

      <cfcomponent>
      <cffunction name="myfnc" access="remote" returntype="any">

      <!--- Check orders where order has (0,1) --->
      <cfquery name="myQuery" datasource="mydb">
      Insert....into table...
      </cfquery>
      </cffunction>

      I don't get any errors in flex or my cfc.
      Note that when I test this function separately in a cfm, it works fine and executes within a few seconds.

      Anyone can help me with this. Is this a problem with Flex or could it be my cfc.