import flash.net.*
send();
function send():void{
var variables:URLVariables = new URLVariables();
variables.yourName = "Joe";
variables.yourAge = "44";
var request:URLRequest = new URLRequest("http://www.messyou.se/flashGet.asp"); //Insert your own URL here.
request.method = URLRequestMethod.POST;
request.data = variables;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, completeHandler);
try{
loader.load(request);
}
catch (error:Error) {
trace("Unable to load URL");
}
}
function completeHandler(event:Event):void{
var variables:URLVariables = new URLVariables(event.target.data);
var msg = variables.msg;
if(msg=="true"){
trace("Done!");
} else{
trace("Error: "+msg);
}
}
//Server side file in Classic ASP
/*
<%
if true then
response.write("msg=" & Server.UrlEncode("true"))
else
response.write("msg=" & Server.UrlEncode("Sorry didn't work"))
end if
%>
*/