I'm using URLLoader to POST to a server. The xml response from the server can respond with a 404 or a 403 (forbidden) error. However I am unable to get the response codes.
Here is the code
var urlString:String = "some url";
var urlRequest:URLRequest = new URLRequest(urlString);
var loader:URLLoader = new URLLoader();
loader.addEventListener( Event.COMPLETE, setXMLData );
loader.addEventListener( IOErrorEvent.IO_ERROR, ioHandler );
loader.addEventListener( HTTPStatusEvent.HTTP_STATUS, httpStatusHandler );[/code]
public function httpStatusHandler(evt:HTTPStatusEvent):void {
trace("status is " + evt.status);
}
status is always 0 regardless whether i return 200, 400, 404, 301, 500, etc...
Any ideas?