Flex MX:HTML handling errors and loading problems

試著忘記壹切 提交于 2019-12-11 03:08:55

问题


I have a simple mx:html that load a page.. I'd like to show a popup when there is a problem loading the page...

How can I handle this event? I have not find anything useful on the web :(


回答1:


mx:html is based on htmlloader, and unfortunately you cannot read HTTP headers using this object, so you cannot read the HTTP status. Several workarounds are:

a)use an urloader before the htmlloader and check the HTTP status

b)you can read the html page content with yourhtmlcontrol.htmlloader.window.document. If it's a known page you can detect if the page content corresponds with some status.

I think that a) is more reliable than b).



来源:https://stackoverflow.com/questions/7567084/flex-mxhtml-handling-errors-and-loading-problems

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!