I once accidentally uploaded only part of my flash program to my website (i.e., it was truncated), and to my biggest surprise, the flash object was loaded successfully into the webpage, no errors were raised, no warnings were given at all. (This was a release version of the player, the debug version might have behaved differently, I don’t know.) Of course, it did not work properly, but still, the preloader screen was displayed correctly, and the download and initialization appeared to be finished normally.
My question is: is there a way to detect (either in actionscript/flash or in the embedding web page) when such a corrupted flash object has been loaded? Can I perhaps use the preloader to give a warning when this happens?
There are a lot of ways to extract the header info from a SWF file (including its file size). Since this info is written at publishing time, it won’t change if the file is truncated after uploading it. So, for instance, you can extract that info and check if the file size (according to the SWF header) == bytes loaded.