Ok after a few hours of messing around I got it working, its not the cleanest
code, and has yet to be optimized. But it works. Basically you create an array
of swf movies. You then send to the LoadMovies function the array of movies...
and it does the rest, it will start at the first one and then play each one
right after another until it reaches the end of the array. I will be using this
to load up a dynamic XML document with the node of the swf files, and it will
display them dynamically... here is the code. btw thanks for your help. B
// first set of listeners
var myListener:Object = new Object();
var my_mcl:MovieClipLoader = new MovieClipLoader();
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");
trace("Current Frame : "+target_mc._currentframe);
trace("total Framesa: "+target_mc._totalframes);
//
checkEnd();
};
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:
};
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");
};
// Now load the files into their targets.
// loads into movie clips
this.createEmptyMovieClip("clip2_mc", this.getNextHighestDepth());
this.createEmptyMovieClip("clip1_mc", this.getNextHighestDepth());
//my_mcl.loadClip("
http://www.macromedia.com/software/drk/images/box_drk5.jpg",
clip1_mc);
//my_mcl.loadClip("testmovie.swf", clip1_mc);
//my_mc1.loadClip("
http://www.macromedia.com/devnet/images/160x160/.jpg",
clip2_mc);
// loads into _level1
//mAIN
//loadMovies(movies);
//my_mcl.addListener(myListener);
var currentPlaying:Number = 0;
my_mcl.addListener(myListener);
movies = new Array();
movies[0] = "testmovie.swf";
movies[1] = "testmovie2.swf";
////
loadMovies(movies);
function loadMovies(movieArray) {
trace("Starting Load Movie Function");
trace("Movie Array Length = "+movieArray.length+" Current Playig =
"+currentPlaying);
trace("Now loading the my_mc1.loadClip("+movieArray[currentPlaying]+",
clip1_mc");
this.createEmptyMovieClip("clip1_mc", this.getNextHighestDepth());
if (currentPlaying == movieArray.length) {
trace("All Movies should be played");
alert("im going to try to stop");
clip1_mc.unloadMovie();
} else {
my_mcl.loadClip(movieArray[currentPlaying], clip1_mc);
}
//my_mc1.loadClip(movieArray[currentPlaying], clip1_mc);
}
//my_mcl.loadClip("testmovie2.swf", clip1_mc);
//
// Second set of listeners
function checkEnd() {
trace("total and currient"+clip1_mc._totalframes+" "+clip1_mc._currentframe);
this.onEnterFrame = function() {
trace("Current: "+clip1_mc._currentframe+" Total: "+clip1_mc._totalframes);
if (clip1_mc._currentframe != 0) {
if (clip1_mc._currentframe == clip1_mc._totalframes) {
trace("We did it baby!");
//this.createEmptyMovieClip(clip1_mc, clip1_mc._depth);
//stop();
currentPlaying = currentPlaying+1;
loadMovies(movies);
}
}
};
}