I'm trying to POST data to an external URL in my AIR for Android app to log in users. It works in the Flash Debugger on my pc, but does not work on my Android device. I have the Internet Permission set for my app. I have listeners set up for IO_ERROR and SECURITY_ERROR but neither of these are fired. It just hangs there and does nothing when I test on the device, but it works fine in the debug player!?!?
EDIT: I've already searched for answers and the closest I came was this: AS3 AIR URLLoader POST which suggest specifying a content-type in my request, but that doesn't solve my issue
EDIT: It also works when I upload it to server and add a crossdomain.xml to the requested site.
public static function login(user:String, pass:String):void
{
username = user;
var request:URLRequest = new URLRequest( "http://mysite.com/"+user+"/login.json" );
request.method = URLRequestMethod.POST;
request.contentType = 'application/x-www-form-urlencoded';
var variables:URLVariables = new URLVariables();
variables.p = pass;
request.data = variables;
var requestor:URLLoader = new URLLoader();
requestor.addEventListener( Event.COMPLETE, loginRequestComplete );
requestor.addEventListener( IOErrorEvent.IO_ERROR, httpRequestError );
requestor.addEventListener( SecurityErrorEvent.SECURITY_ERROR, httpRequestError );
requestor.load( request );
}