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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

this.getNextHighestDepth());<br />

mcLoader.loadClip("http://www.fakedomain.com/images/bad_hair_day.jpg", 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), onLoadComplete (MovieClipLoader.onLoadComplete event<br />

listener)<br />

onLoadInit (MovieClipLoader.onLoadInit event<br />

listener)<br />

onLoadInit = function([target_mc:MovieClip]) {}<br />

Invoked when the actions on the first frame of the loaded clip have been executed. When this<br />

listener has been invoked, you can set properties, use methods, <strong>and</strong> otherwise interact with<br />

the loaded movie. Call this listener on a listener object that you add by using<br />

MovieClipLoader.addListener().<br />

The value for 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 />

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

Parameters<br />

target_mc:MovieClip [optional] - A movie clip loaded by the<br />

MovieClipLoader.loadClip() method.<br />

Example<br />

The following example loads an image into a movie clip instance called image_mc. The<br />

onLoadInit <strong>and</strong> onLoadComplete events are used to determine how long it takes to load the<br />

image. This information is displayed in a text field called timer_txt.<br />

this.createEmptyMovieClip("image_mc", this.getNextHighestDepth());<br />

var mclListener:Object = new Object();<br />

mclListener.onLoadStart = function(target_mc:MovieClip) {<br />

target_mc.startTimer = getTimer();<br />

};<br />

mclListener.onLoadComplete = function(target_mc:MovieClip) {<br />

968 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!