Flex MX:HTML handling errors and loading problems
I have a simple mx:html that load a page.. I'd like to show a popup when there is a problem load开发者_C百科ing the page...
How can I handle this event? I have not find anything useful on the web :(
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).
精彩评论