Onloaderror (Moviecliploader.onloaderror Event Listener) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

onLoadError (MovieClipLoader.onLoadError event
listener)
onLoadError = function(target_mc, errorCode) {}
Invoked when a file loaded with
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
The value for
target_mc
is useful if you are loading multiple files with the same set of listeners.
For the
parameter, the string "URLNotFound" is returned if neither the
errorCode
MovieClipLoader.onLoadStart
for example, if a server is down or the file is not found. The string
returned if
MovieClipLoader.onLoadStart
MovieClipLoader.onLoadComplete
interrupted because of server overload, server crash, and so on.
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
- A movie clip loaded by a
target_mc:
- A string that explains the reason for the failure.
errorCode:
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).bytesTotal+" bytes loaded");
};
MovieClipLoader.loadClip()
identifies the movie clip this call is being made for. This parameter
or
MovieClipLoader.onLoadComplete
was called but
was not called, for example, if the download was
MovieClipLoader.loadClip()
has failed to load. This
MovieClipLoader.addListener()
listener is called,
"LoadNeverCompleted"
method.
MovieClipLoader
.
is
537

Advertisement

Table of Contents
loading

Table of Contents