MovieClipLoader
537
onLoadError (MovieClipLoader.onLoadError event
listener)
onLoadError = function(target_mc, errorCode) {}
Invoked when a file loaded with
MovieClipLoader.loadClip()
has failed to load. This
listener can be invoked for various reasons, including if the server is down, if the file is not
found, or if a security violation occurs.
Call this listener on a listener object that you add using
MovieClipLoader.addListener()
.
The value for
target_mc
identifies the movie clip this call is being made for. This parameter
is useful if you are loading multiple files with the same set of listeners.
For the
errorCode
parameter, the string "URLNotFound" is returned if neither the
MovieClipLoader.onLoadStart
or
MovieClipLoader.onLoadComplete
listener is called,
for example, if a server is down or the file is not found. The string
"LoadNeverCompleted"
is
returned if
MovieClipLoader.onLoadStart
was called but
MovieClipLoader.onLoadComplete
was not called, for example, if the download was
interrupted because of server overload, server crash, and so on.
Availability:
ActionScript 1.0; Flash Lite 2.0
Parameters
target_mc
:
- A movie clip loaded by a
MovieClipLoader.loadClip()
method.
errorCode
:
- A string that explains the reason for the failure.
Example
The following example displays information in the Output panel when an image fails to load.
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).byt" bytes loaded");
};
Summary of Contents for FLASHLITE2 ACTIONSCRIPT-LANGUAGE
Page 1: ...Flash Lite 2 x ActionScript Language Reference...
Page 22: ...22 Contents...
Page 244: ...244 ActionScript language elements...
Page 760: ...760 ActionScript classes...