I'm trying to send multiple sets of variables to a server script via a loop. Unfortunately only the last element of the loop actually gets process by the script although in theory they all should cause it sends all the variables one after another. How can I make the following actually work?
I'm assuming there must have to be a delay to allow the script to react but am not sure how to achieve it. The script does work as the last part of the loop does get processed correctly.Code:resp = new LoadVars() vars = new LoadVars(); for (i=0; i<my_xml.childNodes.length; i++) { vars.uid = _root["shirt" + i].shirt_contents.uid; vars.xposition = _root["shirt" + i]._x; vars.tid = tid; vars.yposition = _root["shirt" + i]._y; vars.eof = 0; vars.sendAndLoad("formationproc.cfm", resp, 'POST') if(i == (my_xml.childNodes.length - 1)) { vars.eof = 1; } resp.onLoad = function(success) { if(success) { removeMovieClip(loader1); removeMovieClip(blackout1); gotoAndStop(1); } } }
Any Ideas?


Reply With Quote