MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference page 536

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

When you use the
onLoadComplete
it's important to understand how this differs from the way they work with your SWF file. The
event is called after the SWF or JPEG file is loaded, but before the
onLoadComplete
application is initialized. At this point you cannot access the loaded movie clip's methods and
properties, and because of this you cannot call a function, move to a specific frame, and so on.
In most situations, it's better to use the
content is loaded and is fully initialized.
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
- A listener object that was added using MovieClipLoader.addListener().
listenerObject:
[optional] - A movie clip loaded by a MovieClipLoader.loadClip() method. This
target_mc:
parameter is optional.
Example
The following example loads an image into a movie clip instance called
and
onLoadInit
onLoadComplete
image. The information appears in a dynamically created 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 "+timerMS+" ms.";
};
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
image_mcl.loadClip("http://www.macromedia.com/images/shared/product_boxes/
112x112/box_studio_112x112.jpg", image_mc);
See also
addListener (MovieClipLoader.addListener method)
(MovieClipLoader.loadClip method)
,
event listener)
onLoadError (MovieClipLoader.onLoadError event listener)
onLoadInit (MovieClipLoader.onLoadInit event listener)
536
ActionScript classes
and
events with the MovieClipLoader class,
onLoadInit
event instead, which is called after the
onLoadInit
events are used to determine how long it takes to load the
,
onLoadStart (MovieClipLoader.onLoadStart
image_mc
,
loadClip
. The
,

Advertisement

Table of Contents
loading

Table of Contents