Flex/Flash is single-threaded. The loop has to complete before moving on to the URLVariables code. I'd double check to see if the data.length is what you expect
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of sunitaleena Sent: Friday, May 18, 2007 9:22 AM To: [email protected] Subject: [flexcoders] Flex help Hi, I am having this problem . I am trying to call this function from a button' s click event. The function is like this: public function Insert():void { myResult.deleteorder(orderid); for (var i:int = 0; i < myData.length; i++ ) { var newProduct:Product = myData[i] ; myService.insertsp( newProduct ) ; }//end for loop var uv:URLVariables = new URLVariables(); var request:URLRequest = new URLRequest ("OrderReview.html"); uv.ordern = lblordern.text; request.data=uv; navigateToURL(request,"_self"); } When I was testing with 2 or 4 records it was working fine. Now I am testing with real data. It just doesn't work . This doesn't wait for the for loop to be finished completely and starts processing the other steps. I want the other steps to be processed after the loop is done. Please help. Is there some wait command in Flex? I am a new bee.. Thanks in advance.

