MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 637

Actionscript language reference
Table of Contents

Advertisement

var myListener:Object = new Object();
myListener.onLoadStart = function(target_mc:MovieClip) {
trace("*********First my_mcl instance*********");
trace("Your load has begun on movie clip = "+target_mc);
var loadProgress:Object = my_mcl.getProgress(target_mc);
trace(loadProgress.bytesLoaded+" = bytes loaded at start");
trace(loadProgress.bytesTotal+" = bytes total at start");
};
myListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number,
totalBytes:Number) {
trace("*********First my_mcl instance Progress*********");
trace("onLoadProgress() called back on movie clip "+target_mc);
trace(loadedBytes+" = bytes loaded at progress callback");
trace(totalBytes+" = bytes total at progress callback");
};
myListener.onLoadComplete = function(target_mc:MovieClip) {
trace("*********First my_mcl instance*********");
trace("Your load is done on movie clip = "+target_mc);
var loadProgress:Object = my_mcl.getProgress(target_mc);
trace(loadProgress.bytesLoaded+" = bytes loaded at end");
trace(loadProgress.bytesTotal+" = bytes total at end");
};
myListener.onLoadInit = function(target_mc:MovieClip) {
trace("*********First my_mcl instance*********");
trace("Movie clip = "+target_mc+" is now initialized");
// you can now do any setup required, for example:
target_mc._width = 100;
target_mc._height = 100;
};
myListener.onLoadError = function(target_mc:MovieClip, errorCode:String) {
trace("*********First my_mcl instance*********");
trace("ERROR CODE = "+errorCode);
trace("Your load failed on movie clip = "+target_mc+"\n");
};
my_mcl.addListener(myListener);
// Now load the files into their targets.
// loads into movie clips
this.createEmptyMovieClip("clip1_mc", this.getNextHighestDepth());
clip1_mc._x = 400;
this.createEmptyMovieClip("clip2_mc", this.getNextHighestDepth());
my_mcl.loadClip("http://www.macromedia.com/software/drk/images/box_drk5.jpg",
clip1_mc);
my_mcl.loadClip("http://www.macromedia.com/devnet/images/160x160/
ben_forta.jpg", clip2_mc);
clip2_mc._x = 200;
// loads into _level1
my_mcl.loadClip("http://www.macromedia.com/devnet/images/160x160/
mike_chambers.jpg", 1);
//
// Second set of listeners
var another_mcl:MovieClipLoader = new MovieClipLoader();
var myListener2:Object = new Object();
myListener2.onLoadStart = function(target_mc:MovieClip) {
trace("*********Second my_mcl instance*********");
trace("Your load has begun on movie = "+target_mc);
MovieClipLoader.loadClip()
637

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?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex

Table of Contents