I was thinking about doing that, but I didn't know if there was a better way--maybe SWFObject has a "failed" event I can listen for? But I haven't been able to find anything like that yet.
There is code in the history.js that attempts to talk to the player that might be helpful. Also, there is a separate email forum just for SWFObject at email@example.com. They seem to be pretty responsive.
That reminds me, if you have custom loading and sizing logic, there is a window of time where SWFObject causes the stage to report a width and height of 0. We have workarounds for that in the SDK, but if you’re code is tripping over that, you could end up sizing the content to 0,0.
We're not doing anything with custom loading and sizing logic, unless the default Flash Builder 4 HTML host file does custom loading and sizing. We haven't changed anything.
SWFObject has an callback function to see if the <object> tag was written onto the page properly, but it doesn't have any way of knowing if the SWF itself was successfully downloaded. Search here for callbackFn to find the info on this.
I hear that CheckPlayer does have a way of determining this... I'm looking into that.
Well, an issue I've run into is that since my Flex app is full-viewport, there's nowhere for me to display an HTML message. The Flash move displays on top of everything as usual.
So, even if I were able to work out a way to determine if the SWF failed to load, I wouldn't be able to display it. But I suppose I could redirect the user to another page where I gave them some useful troubleshooting information.
Any any rate, this got me thinking--why is Flash movie displaying on top of everything--even if I delete the SWF file, so there is no Flash movie to download. Hmm... right click on the big white viewport, and you get "Movie not loaded" in the Flash Player context menu.
So, even though the Flash move is not loaded, the Flash Player did start. Which leads me to ask... is there a way to interrogate the Flash Player directly, and see if it loaded the movie or not?
p.s., I'm aware that I could change the WMODE to transparent to try and let my HTML message show through the SWF, but I want to avoid doing that at all costs :-) I've had too many problems in the past with subtle (and frustrating) errors when I change WMODE away from the default value of Window.
That’s a good point, and brings you full-circle back to ExternalInterface. If you are certain that the player is running, then you go back to the option of using ExternalInterface to handshake to the external app. If no callback exists, then your app didn’t run far enough to register the callback so you can consider that a failure.
I’ve never played with the HTML tags themselves, but I would wonder what would happen if you set the div containing the player to a zero width/height or made it hidden and then if it is up, make the div containing the HTML message hidden.