User Guide

MovieClipLoader 955
Parameters
target_mc:MovieClip - A movie clip loaded by the MovieClipLoader.loadClip()
method.
errorCode:String - A string that explains the reason for the failure, either "URLNotFound"
or
"LoadNeverCompleted".
httpStatus:Number [optional] - (Flash Player 8 only) The HTTP status code returned by
the server. For example, a status code of 404 indicates that the server has not found anything
that matches the requested URI. For more information about HTTP status codes, see sections
10.4 and 10.5 of the HTTP specification at ftp://ftp.isi.edu/in-notes/rfc2616.txt.
Example
The following example displays information in the Output panel when an image fails to load.
The URL used in this example is for demonstration purposes only; replace it with your own
valid URL.
var loadListener:Object = new Object();
loadListener.onLoadError = function(target_mc:MovieClip, errorCode:String,
httpStatus:Number) {
trace(">> loadListener.onLoadError()");
trace(">> ==========================");
trace(">> errorCode: " + errorCode);
trace(">> httpStatus: " + httpStatus);
}
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(loadListener);
var mc:MovieClip = this.createEmptyMovieClip("mc",
this.getNextHighestDepth());
mcLoader.loadClip("http://www.fakedomain.com/images/bad_hair_day.jpg", mc);
If your SWF file includes a version 2 component, use the version 2 component's
DepthManager class instead of the
MovieClip.getNextHighestDepth() method, which is
used in this example.
See also
addListener (MovieClipLoader.addListener method), loadClip
(MovieClipLoader.loadClip method)
, onLoadStart (MovieClipLoader.onLoadStart
event listener)
, onLoadComplete (MovieClipLoader.onLoadComplete event
listener)