MovieClipLoader
541
onLoadStart (MovieClipLoader.onLoadStart event
listener)
onLoadStart = function([target_mc]) {}
Invoked when a call to
MovieClipLoader.loadClip()
has successfully begun to download a
file. Call this listener on a listener object that you add using
MovieClipLoader.addListener()
.
The value for
target_mc
identifies the movie clip this call is being made for. This parameter
is useful if you are loading multiple files with the same set of listeners.
Parameters
target_mc: MovieClip [optional]
A movie clip loaded by a
MovieClipLoader.loadClip()
method.
Availability:
ActionScript 1.0; Flash Lite 2.0
Parameters
target_mc
:
[optional] - A movie clip loaded by a
MovieClipLoader.loadClip()
method.
Example
The following example loads an image into a movie clip instance called
image_mc
. The
onLoadInit
and
onLoadComplete
events are used to determine how long it takes to load the
image. This information appears in a text field called
timer_txt
.
this.createEmptyMovieClip("image_mc", this.getNextHighestDepth());
var mclListener:Object = new Object();
mclListener.onLoadStart = function(target_mc:MovieClip) {
target_mc.startTimer = getTimer();
};
mclListener.onLoadComplete = function(target_mc:MovieClip) {
target_mc.completeTimer = getTimer();
};
mclListener.onLoadInit = function(target_mc:MovieClip) {
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);
Содержание Flash Lite 2
Страница 1: ...Flash Lite 2 x ActionScript Language Reference...
Страница 22: ...22 Contents...
Страница 244: ...244 ActionScript language elements...
Страница 760: ...760 ActionScript classes...