View Full Version : [MX2004] External JPGs & loadMovie()
kBisk
March 12th, 2005, 06:52 PM
I have 100 mc's loading external thumbnail jpgs via loadMovie(). I need a preloader of some sort to show the status of the thumbnails. The problem is that each of the mc's are loading JPG individually and I am not sure of how to combine their loading statuses into a preloader. The other option I had planned to use was to make one thumbnail larger in file size than the others so that it would load last and therefore I could use some onload function for this particular thumbnail, but I do not know what would be best to use in this case.
Any help/suggestions are greatly appreciated.
eki
March 14th, 2005, 09:33 AM
Hi,
I would do something like this:
this.initLoader = function() {
for (var i = 0; i<100; i++) {
this["mc"+i] = this.createEmptyMovieClip("mc"+i, i);
}
this.loadField = this.createTextField("field", 200, 0, 0, 50, 20);
this.loadField.autoSize = true;
this.startLoading();
};
this.startLoading = function(ind) {
if (ind<100) {
this["mc"+ind].loadMovie("thumb"+ind+".jpg");
this.loadField._x = this["mc"+ind]._x;//position it where u want it!
this.loadField._y = this["mc"+ind]._y;
var total = Math.round(this["mc"+ind].getBytesTotal());
this.onEnterFrame = function() {
var loaded = Math.round(this["mc"+ind].getBytesLoaded());
if (loaded>4 && loaded>=total) {
this.onEnterFrame = undefined;
this.loadField.text = "";
ind++;
this.startLoading(ind);
} else {
this.loadField.text = loaded;
}
};
}
};
this.initLoader();
SHO
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.