Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以以某种方式检查 stageWebView 是否没有加载网页吗?例如,如果用户没有互联网连接,它将无法加载 google.com... 我可以检查它是否无法加载 Google.com?
是的! StageWebView抛出一个ErrorEvent.ERROR,所以你可以为它设置一个监听器:
StageWebView
ErrorEvent.ERROR
webView.addEventListener(ErrorEvent.ERROR, onError); //webView is a StageWebView function onError(e:ErrorEvent):void { trace("Page is not available. Try reloading."); }