1 Reply Latest reply on Jul 20, 2012 9:18 AM by nikos101

    Remote object help

    jfb00 Level 3

      Hi All,

      I have a method that I need to call multiple times passing parameters.

      what can i do to wait until the method is back with results before I fire the second time?

      Here is my code:


              <s:RemoteObject id="SM_RO" destination="ColdFusion" source="{cfcPath}" >

                  <s:method name="getData" result="getData_Handler(event)" fault="error_Handler(event)"/>




      My calls:

      private function doCalculations():void{

           SM_RO.getData(3, secondID, myArray, myArrayCollection);

           SM_RO.getData(4, secondID, myArray, myArrayCollection);

           SM_RO.getData(8, secondID, myArray, myArrayCollection);




      private function getData_Handler(event:ResultEvent):void{


                      acTemp = ArrayCollection(event.result);






      I know i can create different methods and wait for each method back and fire the next one but I don't want to create separate methods because they have very long code and they are doing the same thing.