Today at work we ran into another flash player / browser inconsistency. When using MovieClipLoader to load an external asset, the onLoadError event doesn’t fire in Firefox when trying to load an asset from a non-existent domain. In fact, the onLoadStart event doesn’t even fire. The other MovieClipLoader events don’t fire but they shouldn’t, there isn’t any progress and the load never reaches completion or initialization.If you attempt to load a non-existent asset from a valid domain the onLoadError event fires fine in Firefox. In IE and Safari the onLoadError event fires in both scenarios. These are the only browsers I tested but I would be interested in seeing what happens in the others.
So let me break it down. This code doesn’t fire the onLoadError event in Firefox. It just fails silently:
var mLoader:MovieClipLoader = new MovieClipLoader();
var mObj:Object = new Object();
mObj.onLoadError = function(ev:Object):Void {
getURL('javascript:alert("onLoadError")');
}
mLoader.addListener(mObj);
mLoader.loadClip('http://kaljdflkasjdf.com/image.jpg', this);
However, this code and domain do fire the onLoadError event.
var mLoader:MovieClipLoader = new MovieClipLoader();
var mObj:Object = new Object();
mObj.onLoadError = function(ev:Object):Void {
getURL('javascript:alert("onLoadError")');
}
mLoader.addListener(mObj);
mLoader.loadClip('http://www.scottgmorgan.com/image.jpg', this);
Thought I would share this knowledge with the world. Last thing I want is others pulling out as much hair as I do ![]()
April 4th, 2007 at 10:57 pm
Interesting problem that you have there. I am having a similar problem and it is KILLING me:
I have coded a video player that works correctly in IE and FF on Windows, and Safari on OSX, yet fails hard in FF on OSX. I am not sure why, but all of the netStream status events fail to call… not sure what the problem is or why it only happens in the one browser/os configuration.
Thanks for the post, though.
April 11th, 2007 at 10:58 pm
Also strange:
When I use the function loadClip(MediaUrl, targetMovieClip) with an undefined target MovieClip, IE starts loading the MediaUrl. While Firefox loads nothing and gives no response.
Strange!
April 12th, 2007 at 10:58 pm
Hi Rob,
As Strange as it sounds it kind of makes sense. It looks like the onLoadError event will never trigger in FireFox if the onLoadStart event is never fired.
Since the MovieClipLoader class is using the browser to accomplish the http request there must be a difference in how each browser instantiates the call.
Scott