MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
you can put the code for the preloader where the “trace(l/t)” now is.
So if you have a (dynamic) textfield with the instancename “loadInfo” and a loadbar with instancename “loadBar” [size=1](both w/o quotes)[/size], you can change the code like this:
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
percent = Math.round((l/t)*100);
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
loadInfo.text = percent+" % loaded";
loadBar._xscale= percent;
}
}
I used your code, and the preloader works, but it does not ever reach 100% and it doesn’t dissapear off the screen.
Take a look: http://www.vuhuynh.com (the preloader is on the bottom right)