// your statements here
}
Parameters
listenerObject
A movie clip loaded by a
target_mc
A string that explains the reason for the failure.
errorCode
Returns
One of two strings:
Description
Listener; invoked when a file loaded with
The string
"URLNotFound"
MovieClipLoader.onLoadComplete
the file is not found, these listeners are not called.
The string
"LoadNeverCompleted"
but
MovieClipLoader.onLoadComplete
MovieClipLoader.onLoadStart
overload, server crash, and so on,
The value for
target_mc
are loading multiple files with the same set of listeners. This optional parameter is passed to your
ActionScript.
Example
The following example writes information to the log file when an image fails to load. This occurs
when you test the following ActionScript, because the image does not exist in the specified
location.
this.createEmptyMovieClip("image_mc", this.getNextHighestDepth());
var mclListener:Object = new Object();
mclListener.onLoadError = function(target_mc:MovieClip, errorCode:String) {
trace("ERROR!");
switch (errorCode) {
case 'URLNotFound' :
trace("\t Unable to connect to URL: "+target_mc._url);
break;
case 'LoadNeverCompleted' :
trace("\t Unable to complete download: "+target_mc);
break;
}
};
mclListener.onLoadInit = function(target_mc:MovieClip) {
trace("success");
trace(image_mcl.getProgress(target_mc).bytesTotal+" bytes loaded");
};
var image_mcl:MovieClipLoader = new MovieClipLoader();
640
Chapter 7: ActionScript for Flash
A listener object that was added using
MovieClipLoader.loadClip()
or
"URLNotFound"
"LoadNeverCompleted"
is returned if neither the
listener has been called. For example, if a server is down or
is returned if
is called but the download is interrupted due to server
MovieClipLoader.onLoadComplete
identifies the movie clip this call is being made for. This is useful if you
MovieClipLoader.addListener()
MovieClipLoader.loadClip()
MovieClipLoader.onLoadStart
MovieClipLoader.onLoadStart
was not called. For example, if
method.
.
has failed to load.
was called
will not be called.
.
or
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?