This content has been marked as final. Show 3 replies
I'm not sure if that syntax is perfect, so look up the documentation... but flash waits it has to do with calls being asynchronous, and synchronous...
i had the exact same problem, here is the blog post
Well maybe working on your object 'myService' : give two parameters to your myService with an int = i inside your loop.
Then check this int in your insertsp function and when this int == myData.length launch your 3rd part of code there (suppress it from your function insert).
It's a problem to control very efficiently sequences of actions in Flex, but if you want to do so, I think it is better to separate into many functions and wait each time for the upper one (just like this time with your loop).
Thanks a lot for your reply. But my NavigateToUrl function is not inside the loop. The loop is for inserting data into a sql server table. I just want the third step to run after the loop is finished. It was working fine for 3-5 records. But when there are more records it just doesn't wait and executes the third step.. Is there any way ?