This sounds like it’s probably an issue with your project settings, but I’ll share some [modified] code I’ve used successfully in the past (this was wrapped in a class but it should be easy to adapt to whatever you want).
public static function init():void
{
var request:URLRequest = new URLRequest(_url + "register.php");
var variables:URLVariables = new URLVariables();
// variables["key"] = "value" for each of your variables here
request.data = variables;
request.method = "POST";
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, eventComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioError);
loader.load(request);
}
private static function ioError(event:Event):void
{
// provide some sort of error message here
}
private static function eventComplete(event:Event):void
{
var loader:URLLoader = URLLoader(event.target);
var data:String = loader.data;
// data contains the contents of the page after the request
// (use PHP's echo function to output server-side if you need to)
}
I seem to remember - in one project, but not another - having to move my SWF out of its build folder and onto my Desktop in order for it to work. But I think that might have been with a local file, not a URLRequest, and I could have probably tweaked some setting to fix it, but there was no point. Also this is the opposite of what you described, so…?
You could also try building under a Release configuration rather than a Debug build. Not sure if it’ll help.