I have some script which can preload all my external swfs to a container before continuing
however my total% show 100% for the first then %100 for the second etc. how do i modify the code so it also show loaded 1/7, 2/7, 3/7 etc?
here is the as.
var movieArray:Array = new Array("d1.swf", "d2.swf", "d3.swf", "d4.swf", "d5.swf", "d6.swf", "d7.swf");
var moviePath:String = "";
var movieNum:Number = 0;
var movieLoadedTotal:Number = 0;
var movieListener:MovieClipLoader = new MovieClipLoader();
var movieListenerObject:Object = new Object();
_root.createEmptyMovieClip("containerMC", _root.getNextHighestDepth());
movieListenerObject.onLoadStart = function(targetMC:MovieClip) {
movieLoadedTotal++;
};
movieListenerObject.onLoadProgress = function(targetMC:MovieClip, loadedBytes:Number, totalBytes:Number) {
load_txt.text = "%"+Math.round((loadedBytes/totalBytes)*100);
};
movieListenerObject.onLoadComplete = function(targetMC:MovieClip) {
};
movieListenerObject.onLoadInit = function(targetMC:MovieClip) {
if (movieLoadedTotal<movieArray.length) {
movieNum++;
movieListener.loadClip(moviePath+movieArray[movieNum], _root.containerMC);
} else {
trace("movies loaded");
}
};
movieListenerObject.onLoadError = function(targetMC:MovieClip, errorCode:String) {
};
movieListener.addListener(movieListenerObject);
movieListener.loadClip(moviePath+movieArray[movieNum], _root.containerMC);