LoadVars.sendAndLoad w/ XML response


/ Published in: ActionScript
Save to your folder(s)

Concerning: LoadVars.sendAndLoad

You can send variable/value post information and receive xml information by using code like below.

It's a great way to work with web services and avoid using the modem-unfriendly web service connector component. can adobe confirm that this method of sending with loadVars and receiving xml will be supported in the future?


Copy this code and paste it in your HTML
  1. var replyXML = new XML();
  2. replyXML.onLoad = myOnLoad;
  3. function myOnLoad(success)
  4. {
  5. if (success) {
  6. trace(replyXML);
  7. } else {
  8. trace('fail');
  9. }
  10. }
  11.  
  12. var send_lv = new LoadVars();
  13. send_lv.postVar = "foo";
  14. send_lv.sendAndLoad("addressOfMyWebServiceOrOtherProgram", replyXML, "POST");

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.