我一直在尝试使以下代码正常工作:
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("消息已发送。");
}
function handleLoadError($evt:IOErrorEvent):void { trace("消息失败。"); }
奇怪的是,它可以正确地从 Flash 中发布。但是当我上传到我的网络服务器时,它并没有……有什么想法吗?
谢谢亚历克斯