Actionscript 3 Flash Wierdness-#2032错误,但Apache返回200
我有一个小的flash应用程序,可以加载一个小的(10行)xml文件。大多数情况下,这一切都很好。但是,有时我看到flash应用程序无法加载xml文件,并抛出一个#2032错误 当应用程序无法加载xml文件时,它会每15秒重新请求一次。这些重新请求都因抛出2032错误而失败,但是,跟踪Apache日志会显示每个请求的http状态为200 闪存ULRLoader收到http状态事件200,然后立即显示#2032错误。对这里可能发生的事情有什么想法吗 谢谢 代码:Actionscript 3 Flash Wierdness-#2032错误,但Apache返回200,actionscript-3,Actionscript 3,我有一个小的flash应用程序,可以加载一个小的(10行)xml文件。大多数情况下,这一切都很好。但是,有时我看到flash应用程序无法加载xml文件,并抛出一个#2032错误 当应用程序无法加载xml文件时,它会每15秒重新请求一次。这些重新请求都因抛出2032错误而失败,但是,跟踪Apache日志会显示每个请求的http状态为200 闪存ULRLoader收到http状态事件200,然后立即显示#2032错误。对这里可能发生的事情有什么想法吗 谢谢 代码: 为什么在公共函数loadData(
为什么在公共函数loadData(url:String=null):void url=null????在firefox或chrome中打开页面,查看网络活动是的,Ilya Z就在这里。该参数不应该是可选的,因为该方法依赖于该参数不为null。
public class XMLLoader
{
private var xml:XML;
private var loader:URLLoader = new URLLoader();
private var callback:Function;
function XMLLoader(c:Function = null)
{
callback = c;
}
public function loadData(url:String = null):void
{
loader.addEventListener(Event.COMPLETE, onLoaded);
loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
loader.addEventListener(Event.OPEN, onOpen);
loader.addEventListener(ProgressEvent.PROGRESS, onProgress);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHttpStatus);
loader.load(new URLRequest(url + "?now=" + timeNow()));
}
private function timeNow()
{
var timeNow:Date = new Date();
return timeNow.valueOf();
}
private function onOpen(event:Event):void
{
callback("Open: " + String(event));
}
private function onProgress(event:ProgressEvent):void
{
callback("Progress: loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);
}
private function onSecurityError(event:SecurityErrorEvent):void
{
callback("Security Error: " + event);
}
private function onHttpStatus(event:HTTPStatusEvent):void
{
callback("Http Status: " + event);
}
private function onLoaded(event:Event):void
{
xml = new XML(event.target.data);
callback("ISLD: " + event);
callback("Success", xml);
}
private function onIOError(event:IOErrorEvent):void
{
callback("IOError" + event);
}