MovieClipLoader
539
var timerMS:Number = target_mc.completeTimer-target_mc.startTimer;
target_mc.createTextField("timer_txt", target_mc.getNextHighestDepth(),
0, target_mc._height,
target_mc._width, 22);
target_mc.timer_txt.text = "loaded in "+" ms.";
};
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
image_mcl.loadClip("http://www.helpexamples.com/flash/images/image1.jpg",
image_mc);
The following example checks whether a movie is loaded into a movie clip created at runtime:
this.createEmptyMovieClip("tester_mc", 1);
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip) {
trace("movie loaded");
}
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
image_mcl.loadClip("http://www.yourserver.com/your_movie.swf", tester_mc);
See also
addListener (MovieClipLoader.addListener method)
,
loadClip
(MovieClipLoader.loadClip method)
,
onLoadStart (MovieClipLoader.onLoadStart
event listener)
onLoadProgress (MovieClipLoader.onLoadProgress
event listener)
onLoadProgress = function([target_mc], loadedBytes, totalBytes) {}
Invoked every time the loading content is written to disk during the loading process (that is,
between
MovieClipLoader.onLoadStart
and
MovieClipLoader.onLoadComplete
). Call
this listener on a listener object that you add using
MovieClipLoader.addListener()
. You
can use this method to display information about the progress of the download, using the
loadedBytes
and
totalBytes
parameters.
The value for
target_mc
identifies the movie clip this call is being made for. This is useful if
you are loading multiple files with the same set of listeners.
Note:
If you attempt to use
onLoadProgress
in test movie mode with a local file that resides
on your hard disk, it will not work properly because, in test movie mode, Flash Player loads
local files in their entirety.
Summary of Contents for FLASHLITE2 ACTIONSCRIPT-LANGUAGE
Page 1: ...Flash Lite 2 x ActionScript Language Reference...
Page 22: ...22 Contents...
Page 244: ...244 ActionScript language elements...
Page 760: ...760 ActionScript classes...