MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 641

Actionscript language reference
Table of Contents

Advertisement

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 movie clip loaded by a
target_mc
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
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
and
onLoadInit
image. This information displays in a text field called
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 "+timerMS+" ms.";
};
A listener object that was added using
MovieClipLoader.loadClip()
identifies the movie clip this call is being made for. This is useful if you
events are used to determine how long it takes to load the
onLoadComplete
MovieClipLoader.addListener()
method. This parameter
image_mc
.
timer_txt
MovieClipLoader.onLoadInit
.
. The
641

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flex

Table of Contents