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.

var container:MovieClip = createEmptyMovieClip("container",<br />

getNextHighestDepth());<br />

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

mcLoader.addListener(this);<br />

mcLoader.loadClip("YourImage.jpg", container);<br />

function onLoadInit(mc:MovieClip) {<br />

trace("onLoadInit: " + mc);<br />

}<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 />

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

MovieClipLoader constructor<br />

public MovieClipLoader()<br />

Creates a MovieClipLoader object that you can use to implement a number of listeners to<br />

respond to events while a SWF, JPEG, GIF, or PNG file is downloading.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 7<br />

Example<br />

See MovieClipLoader.loadClip().<br />

See also<br />

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

(MovieClipLoader.loadClip method)<br />

onLoadComplete<br />

(MovieClipLoader.onLoadComplete event listener)<br />

onLoadComplete = function([target_mc:MovieClip], [httpStatus:Number]) {}<br />

Invoked when a file that was loaded with MovieClipLoader.loadClip() is completely<br />

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

MovieClipLoader.addListener(). The onLoadComplete event listener is passed by Flash<br />

Player to your code, but you do not have to implement all of the parameters in the listener<br />

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

This identification is useful when multiple files are being loaded with the same set of listeners.<br />

964 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!