Last Updated: February 25, 2016
·
498
· oreth

URL Request with Post Data

var loader : URLLoader = new URLLoader();

var request : URLRequest = new URLRequest("http://somedomain.com/someurl.php");

request.method = URLRequestMethod.POST;

var variables : URLVariables = new URLVariables();

variables.requestParam1 = "value1";

variables.requestParam2 = "value2";

request.data = variables;

// Handlers

loader.addEventListener(Event.COMPLETE, oncomplete);

loader.load(request);

private function on
complete(e : Event):void{

// whatever
}