为什么这对我不起作用?
我需要的只是获取index.php?mykey=123
mykey
和123
从 url
我只需要最短版本的波纹管即可获得上述信息并将其放入文本框中。
var dataSet:String;
var variables:URLVariables = new URLVariables("country_id=179");
var request:URLRequest = new URLRequest();
request.url = "http://admin.dev.ts.xxx.com/ajax/ttt_ttt.php";
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 {
trace(event.target.data.welcomeMessage);
dataSet = loader.data;
trace(dataSet);
textbox.text = trace(dataSet);
}
如果我调试,我也会收到一些错误
[SWF] E:\get_post.swf - 3495 bytes after decompression
Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: http://admin.dev.ts.xxx.com/ajax/ttt_ttt.php
at get_post_fla::MainTimeline/frame1()[get_post_fla.MainTimeline::frame1:10]