/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var variables:URLVariables = new URLVariables(); variables.miavariabile = "Ciao"; var request:URLRequest = new URLRequest(); request.url = "http://www.miodominio.com/miapagina.php"; request.method = URLRequestMethod.POST; request.data = variables; var loader:URLLoader = new URLLoader(); loader.dataFormat = URLLoaderDataFormat.TEXT; loader.addEventListener(Event.COMPLETE, completeHandler); try { loader.load(request); } catch (error:Error) { trace("Errore nel caricamento dell' URL"); } function completeHandler(event:Event):void { var x_xml:XML = XML(event.target.data); trace(x_xml); }
URL: http://www.undolog.com/2007/12/14/flash-cs3-comunicazione-con-un-web-server/