MovieClipLoader.getProgress()
report the actual
bytesLoaded
local. When you use the Bandwidth Profiler feature in the authoring environment,
MovieClipLoader.getProgress()
the download at the actual download rate, not at the reduced bandwidth rate that the Bandwidth
Profiler provides.
Example
The following example illustrates the use of many of the MovieClipLoader class methods and
listeners:
// first set of listeners
var my_mcl:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myListener.onLoadStart = function(target_mc:MovieClip) {
trace("*********First my_mcl instance*********");
trace("Your load has begun on movie clip = "+target_mc);
var loadProgress:Object = my_mcl.getProgress(target_mc);
trace(loadProgress.bytesLoaded+" = bytes loaded at start");
trace(loadProgress.bytesTotal+" = bytes total at start");
};
myListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number,
totalBytes:Number) {
trace("*********First my_mcl instance Progress*********");
trace("onLoadProgress() called back on movie clip "+target_mc);
trace(loadedBytes+" = bytes loaded at progress callback");
trace(totalBytes+" = bytes total at progress callback");
};
myListener.onLoadComplete = function(target_mc:MovieClip) {
trace("*********First my_mcl instance*********");
trace("Your load is done on movie clip = "+target_mc);
var loadProgress:Object = my_mcl.getProgress(target_mc);
trace(loadProgress.bytesLoaded+" = bytes loaded at end");
trace(loadProgress.bytesTotal+" = bytes total at end");
};
myListener.onLoadInit = function(target_mc:MovieClip) {
trace("*********First my_mcl instance*********");
trace("Movie clip = "+target_mc+" is now initialized");
// you can now do any setup required, for example:
target_mc._width = 100;
target_mc._height = 100;
};
myListener.onLoadError = function(target_mc:MovieClip, errorCode:String) {
trace("*********First my_mcl instance*********");
trace("ERROR CODE = "+errorCode);
trace("Your load failed on movie clip = "+target_mc+"\n");
};
my_mcl.addListener(myListener);
// Now load the files into their targets.
// loads into movie clips
this.createEmptyMovieClip("clip1_mc", this.getNextHighestDepth());
clip1_mc._x = 400;
this.createEmptyMovieClip("clip2_mc", this.getNextHighestDepth());
and
MovieClipLoaderListener.onLoadProgress
and
values in the Authoring player when the files are
bytesTotal
and
MovieClipLoaderListener.onLoadProgress
MovieClipLoader.loadClip()
do not
report
605
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?
Questions and answers