2

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 :(

Kodiak
  • 5,978
  • 17
  • 35
Marcx
  • 6,806
  • 5
  • 46
  • 69

1 Answers1

2

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

Cornel Creanga
  • 5,311
  • 1
  • 22
  • 28
  • thank you... I used the option A, urlloader for checking the connection and the HTTP Status, then if HTTP_STATUS = 200, the urlloader load the page.. :) – Marcx Sep 29 '11 at 20:04