Marcx
Marcx

Reputation: 6826

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 loading the page...

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

Upvotes: 2

Views: 772

Answers (1)

Cornel Creanga
Cornel Creanga

Reputation: 5308

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).

Upvotes: 2

Related Questions