Posted By

gfazioli on 01/18/08


Tagged

get php actionscript post server flash xml web internet 30 CS3 LoadVars sendAndLoad Sviluppo Tutorials URLLoader URLRequest URLVariables


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

gfazioli


Flash CS3: comunicazione con un Web Server


 / Published in: ActionScript 3
 

URL: http://www.undolog.com/2007/12/14/flash-cs3-comunicazione-con-un-web-server/

  1. var variables:URLVariables = new URLVariables();
  2. variables.miavariabile = "Ciao";
  3. var request:URLRequest = new URLRequest();
  4. request.url = "http://www.miodominio.com/miapagina.php";
  5. request.method = URLRequestMethod.POST;
  6. request.data = variables;
  7. var loader:URLLoader = new URLLoader();
  8. loader.dataFormat = URLLoaderDataFormat.TEXT;
  9. loader.addEventListener(Event.COMPLETE, completeHandler);
  10. try {
  11. loader.load(request);
  12. } catch (error:Error) {
  13. trace("Errore nel caricamento dell' URL");
  14. }
  15. function completeHandler(event:Event):void {
  16. var x_xml:XML = XML(event.target.data);
  17. trace(x_xml);
  18. }

Report this snippet  

You need to login to post a comment.