Flash CS3: comunicazione con un Web Server


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



Copy this code and paste it in your HTML
  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. }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.