我的错误是
Error opening URL "http://www.website.com/something.php?query=someinvalidquery"
该查询实际上不应该执行,但是我想要某种错误消息这样说。
最佳答案
假设您使用的是URLLoader
或其他内容,您想为其附加一个事件以捕获错误。然后,您可以显示文本字段或任何您想要的内容。
var url = "http://www.website.com/something.php?query=someinvalidquery";
var loader = new URLLoader();
loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
loader.load(url);
function errorHandler(event:IOErrorEvent):void {
trace('do whatever to handle the error here.');
}
如果您想处理重定向等操作,也可以跟踪httpstatus等。使用的事件是in the docs
关于flash - 一旦变成.swf,您如何在Flash中以某种方式显示错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3763552/