03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - 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.

eak;<br />

}<br />

};<br />

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

trace("success");<br />

trace(image_mcl.getProgress(target_mc).bytesTotal+" bytes loaded");<br />

};<br />

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

image_mcl.addListener(mclListener);<br />

image_mcl.loadClip("http://www.fakedomain.com/images/bad_hair_day.jpg",<br />

image_mc);<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]) {}<br />

Invoked when the actions on the first frame of the loaded clip are executed. After this listener<br />

is invoked, you can set properties, use methods, <strong>and</strong> otherwise interact with the loaded movie.<br />

Call this listener on a listener object that you add using MovieClipLoader.addListener().<br />

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

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

Parameterstarget_mc: MovieClip [optional] A movie clip loaded by a<br />

MovieClipLoader.loadClip() method.<br />

Parameters<br />

target_mc: [optional] - A movie clip loaded by a 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 appears 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 />

490 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!