MovieClipLoader.onLoadInit
641
image_mcl.addListener(mclListener);
image_mcl.loadClip("http://www.fakedomain.com/images/bad_hair_day.jpg",
image_mc);
MovieClipLoader.onLoadInit
Availability
Flash Player 7.
Usage
listenerObject
.onLoadInit = function([
target_mc:MovieClip
]) {
// your statements here
}
Parameters
listenerObject
A listener object that was added using
MovieClipLoader.addListener()
.
target_mc
A movie clip loaded by a
MovieClipLoader.loadClip()
method. This parameter
is optional.
Returns
Nothing.
Description
Listener; invoked when the actions on the first frame of the loaded clip have been executed. After
this listener has been invoked, you can set properties, use methods, and otherwise interact with
the loaded movie.
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. This optional parameter is passed to your
ActionScript.
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 displays 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.";
};
Содержание FLEX
Страница 1: ...Flex ActionScript Language Reference ...
Страница 8: ......
Страница 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0 ...
Страница 76: ......
Страница 133: ...break 133 See also for for in do while while switch case continue throw try catch finally ...
Страница 135: ...case 135 See also break default strict equality switch ...
Страница 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while ...
Страница 229: ...while 229 i 3 The following result is written to the log file 0 3 6 9 12 15 18 See also do while continue for for in ...
Страница 808: ...808 Chapter 7 ActionScript for Flash ...
Страница 810: ...810 Appendix A Deprecated Flash 4 operators ...
Страница 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code ...
Страница 816: ...816 Appendix B Keyboard Keys and Key Code Values ...
Страница 822: ...822 Index ...