All pastes #783841 Raw Edit

Untitled

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

MovieClip.prototype.fadeOut = function() {
	this.onEnterFrame = function(){
		if(this._alpha > 0) {
			trace(Math.round(this._alpha));
			this._alpha -= 10;
		}
		else{
			trace("Stoped");
			delete this.onEnterFrame;
		}
	}
}


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;
	this.bar._alpha = 100;
	this.mytext._visible = true;
	
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
	this.bar._width = Math.round((lBytes/tBytes)*100);
	this.mytext.text = bar._width + " %";
};
preload.onLoadComplete = function(targetMC) {
	this.container.fadeIn();
	this.bar.fadeOut();
	mytext._visible = false;
};

var theMC = this.attachMovie("empty", "empty1", 1, {_x:10, _y:10});
theMC.createEmptyMovieClip("thecon", 100);
my_mc.loadClip("photos/cow.jpg", theMC.thecon);