All pastes #783728 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-11-19 10:05 UTC
rendered paste body
MovieClip.prototype.fadeIn = function() {
	this.onEnterFrame = function() {
		if (this._alpha<100) {
			this._alpha += 10;
		} else {
			delete this.onEnterFrame;
		}
	};
};

bar._visible = false;
mytext._visible = true;
var empty = this.createEmptyMovieClip("container", "100");
empty._x = 0;
empty._y = 0;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {
	container._alpha = 0;
	bar._visible = true;
	mytext._visible = true;
	
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
	bar._width = Math.round((lBytes/tBytes)*100);
	mytext.text = bar._width + " %";
};
preload.onLoadComplete = function(targetMC) {
	container.fadeIn();
	bar._visible = false;
	mytext._visible = false;
};