views:

134

answers:

2

The specific problem I’m facing is with a buggy Flash application that I don’t control. When it fails, I’d like to display alternate content.

The page which contains the Flash content has loaded and it’s clearly the Flash app making the request that results in this message in the debug console:

Failed to load resource: the server responded with a status of 404 (Not Found) /path/filename

So I'm wondering if there’s some way to detect that with some JavaScript that loads with the page that contains the Flash object.

I tried window.onerror, but that’s not detecting it.

+1  A: 

If it's a request being made from within Flash, I'd say no. Only browser add-ons (such as Firebug) can monitor all requests.

Matti Virkkunen
A: 

The only way to detect that with JS is to have JS on your 404 page. You only get the 404 when the specified content can't be vended, so no JS would be vended either.

Robusto