Moviecliploader.onloaderror - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

MovieClipLoader.onLoadError

Availability
Flash Player 7.
Usage
listenerObject.onLoadError = function(target_mc:Object, errorCode:String) {
// 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 displays information in the Output panel 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;
A listener object that was added using MovieClipLoader.addListener().
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.loadClip()
MovieClipLoader.onLoadStart
MovieClipLoader.onLoadStart
was not called. For example, if
MovieClipLoader.onLoadError
method.
.
has failed to load.
or
was called
will not be called.
609

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents