0 Replies Latest reply on May 29, 2007 2:12 PM by SUNITAR

    Flex looping


      I have this function which inserts data into a sql server table thru remote object. The insert function runs inside a loop.
      Like this:
      for (var i:int = 0; i < myData.length; i++ ) {

      var newProduct:Product = myData ;

      myService.insertsp( newProduct ) ;
      }//end for loop

      I want to call another function after all the insert is done. But when I am calling the function it just runs the 2nd function even before all the insert is done. Is there any way I can call the function when the function 1 is finished with all the inserts. I tried making the function a boolean and call the other function if this returns true. but it does n't work. It runs the next function even before the first function is finished. Please help.. I am a new bee.. Thanks in advance..