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.

Note: If you attempt to use onLoadProgress in test movie mode with a local file that resides<br />

on your hard disk, it will not work properly because, in test movie mode, Flash Player loads<br />

local files in their entirety.<br />

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

MovieClipLoader.loadClip() method.<br />

loadedBytes: Number The number of bytes that had been loaded when the listener was<br />

invoked.<br />

totalBytes: Number The total number of bytes in the file being loaded.<br />

Parameters<br />

target_mc: [optional] - A movie clip loaded by a MovieClipLoader.loadClip() method.<br />

loadedBytes: - The number of bytes that had been loaded when the listener was invoked.<br />

totalBytes: - The total number of bytes in the file being loaded.<br />

Example<br />

The following example creates a new movie clip, a new MovieClipLoader <strong>and</strong> an anonymous<br />

event listener. It should periodically output the progress of a load <strong>and</strong> finally provide<br />

notification when the load is complete <strong>and</strong> the asset is available to ActionScript.<br />

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

this.getNextHighestDepth());<br />

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

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

listener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number,<br />

bytesTotal:Number):Void {<br />

trace(target + ".onLoadProgress with " + bytesLoaded + " bytes of " +<br />

bytesTotal);<br />

}<br />

listener.onLoadInit = function(target:MovieClip):Void {<br />

trace(target + ".onLoadInit");<br />

}<br />

mcLoader.addListener(listener);<br />

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

See also<br />

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

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

method)<br />

492 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!