03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

loadListener.onLoadInit = function(target_mc:MovieClip):Void {<br />

trace(">> loadListener.onLoadInit()");<br />

trace(">> =============================");<br />

trace(">> target_mc._width: " + target_mc._width); // 315<br />

}<br />

var mcLoader:MovieClipLoader = new MovieClipLoader();<br />

mcLoader.addListener(loadListener);<br />

var mc:MovieClip = this.createEmptyMovieClip("mc",<br />

this.getNextHighestDepth());<br />

mcLoader.loadClip("http://www.w3.org/Icons/w3c_main.png", mc);<br />

If your SWF file includes a version 2 component, use the version 2 component's<br />

DepthManager class instead of the MovieClip.getNextHighestDepth() method, which is<br />

used in this example.<br />

See also<br />

addListener (MovieClipLoader.addListener method), loadClip<br />

(MovieClipLoader.loadClip method), onLoadStart (MovieClipLoader.onLoadStart<br />

event listener), onLoadError (MovieClipLoader.onLoadError event listener),<br />

onLoadInit (MovieClipLoader.onLoadInit event listener)<br />

onLoadError (MovieClipLoader.onLoadError event<br />

listener)<br />

onLoadError = function(target_mc:MovieClip, errorCode:String,<br />

[httpStatus:Number]) {}<br />

Invoked when a file loaded with MovieClipLoader.loadClip() has failed to load. This<br />

listener can be invoked for various reasons; for example, if the server is down, the file is not<br />

found, or a security violation occurs.<br />

Call this listener on a listener object that you add by using<br />

MovieClipLoader.addListener().<br />

The value of target_mc identifies the movie clip for which this call is being made. This<br />

parameter is useful if you are loading multiple files with the same set of listeners.<br />

For the errorCode parameter, the string "URLNotFound" is returned if neither the<br />

MovieClipLoader.onLoadStart or MovieClipLoader.onLoadComplete listener has been<br />

called; for example, if a server is down or the file is not found. The string<br />

"LoadNeverCompleted" is returned if MovieClipLoader.onLoadStart was called but<br />

MovieClipLoader.onLoadComplete was not called; for example, if the download was<br />

interrupted because of server overload, server crash, <strong>and</strong> so on.<br />

966 <strong>ActionScript</strong> classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!