【发布时间】:2012-09-13 05:37:36
【问题描述】:
我一直在尝试让以下代码工作:
var scriptRequest:URLRequest = new URLRequest("http://mywebsite.com/script.php");
var scriptLoader:URLLoader = new URLLoader();
var scriptVars:URLVariables = new URLVariables();
scriptLoader.addEventListener(Event.COMPLETE, handleLoadSuccessful); scriptLoader.addEventListener(IOErrorEvent.IO_ERROR, handleLoadError);
function write(write_to_file) {
scriptVars.req = "testing testing testing";
scriptRequest.method = URLRequestMethod.POST;
scriptRequest.data = scriptVars;
scriptLoader.load(scriptRequest); }
function handleLoadSuccessful($evt:Event):void
{
trace("消息已发送。");
}
函数handleLoadError($evt:IOErrorEvent):void { trace("消息失败。"); }
奇怪的是,它可以从 Flash 正确 POST.. 但是当我上传到我的网络服务器时它没有...有什么想法吗?
谢谢 亚历克斯
【问题讨论】: