This content has been marked as final. Show 2 replies
If the array is large it could take a while to do that as each single element would represent a single http exchange. If the subsequent values being sent are not changing as a result of each individual one's response from the server then I would be inclined to send them all at once. (Within reason... if there is a huge amount then perhaps its helpful to split them up also).
You could do what you're describing using LoadVars or XML (depends on the data type in each array element, and also on preference) , using the sendAndLoad method to send to the server script which processes each element and send back a response to the sendAndLoad method's receiving target argument (usually the same type: either another LoadVars or another XML). You would start the sequence again in that receiving object's onLoad handler. Check out some of the examples for LoadVars.sendAndLoad or XML.sendAndLoad in the help files.
Or you may want to investigate remoting (e.g. amfphp etc)
In just read the title of your topic. In the example I described above you wouldn't use a for loop. You would use a variable to keep track of the current index and increment it each time as you process the next one. The loop is 'event' based, driven by the amount of time it takes for each upload/download cycle for the data being exchanged.