as3代码:
public function exists(uid:String):void {
request = new URLRequest("http://localhost/index.php");
request.method = URLRequestMethod.POST;
variables = new URLVariables();
variables.uid = uid;
request.data = variables;
loader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, urlLoader_existsHandler);
loader.load(request);
}
protected function urlLoader_existsHandler(event:Event):void {
trace(event);
//var variables:URLVariables = URLLoader(event.target).data;
//trace(variables);
//trace(variables.success);
}
PHP输出
成功= 1&安培; registration_id = 1
错误是:
答案 0 :(得分:1)
使用TEXT格式代替VARIABLES
loader.dataFormat = URLLoaderDataFormat.TEXT;
以下是相关文档: