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

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

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

Example<br />

The following example shows you how to use the MovieClipLoader.loadClip method by<br />

creating h<strong>and</strong>ler for the onLoadInit event <strong>and</strong> then making the request.<br />

The following code should either be placed directly into a frame action on a timeline, or<br />

pasted into a class that extends MovieClip.<br />

Create a h<strong>and</strong>ler method for the onLoadInit event.<br />

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

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

}<br />

Create an empty MovieClip <strong>and</strong> use the MovieClipLoader to load an image into it.<br />

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

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

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(listenerObject, [target_mc]) {}<br />

MovieClipLoader 487

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

Saved successfully!

Ooh no, something went wrong!