With a recent update either in IE8 or within the Flash Player, I noticed a lot of our AS2 Flash sites that load external assets were failing; either the asset wouldn’t load or it wouldn’t properly report its EVENT_LOADED event. It was happening sporadically, and usually when a lot of external assets were being loaded at the same time.
When I looked into this further I found this line of code within the “run” function that executes on an interval:
if (mc_clip.getBytesTotal( ) < 0)
{
// failed to load
bool_isLoaded = false;
clearInterval( int_interval );
dispatchEvent( new Event( this, EVENT_FAILED ) );
}
To fix it, I simply added a counter. It now checks to see if getBytesTotal( ) returns negative 10 times before finally reporting EVENT_FAILED.
However, in IE, mc_clip.getBytesTotal( ) is returning a negative number - even though the clip exists and is still loading!
Updating this code to include a wait counter to make sure this the number is still negative after 10 tries seems to have fixed it.
if (mc_clip.getBytesTotal( ) < 0)
{
if (int_wait > 10)
{
// failed to load
bool_isLoaded = false;
clearInterval( int_interval );
dispatchEvent( new Event( this, EVENT_FAILED ) );
}
int_wait++;
}


April 28, 2010 at 2:29 pm
Internet Explorer 8 is very good because it is as stable as Opera. I hate the previous versions of IE like IE6 because it hangs frequently. .