munky.net

design and open source

Useful undocumented properties of the Loader.progress event

| 0 comments

Two very useful additional properties of the event object passed to the hander for the Loader.progress event are evt.current (current number of bytes loaded) and evt.total (total bytes to load).

Example:

var loadListener = new Object();
loadListener.handleEvent = function(evt) {
if (evt.type == "progress") {
trace("PROGRESS: "+evt.current+" of "+evt.total);
}
};
myFormOrSlideOrWhatever.addEventListener("progress", loadListener);
myFormOrSlideOrWhatever.load();

Looks like the Loader component is probably based on the MovieClipLoader AS object. The MovieClipLoader.onLoadProgress entry in the docs mention the current and total properties of that event.

Leave a Reply

Required fields are marked *.