All pastes #217568 Raw Edit

fadeIn/Out

public text v1 · immutable
#217568 ·published 2006-10-23 18:18 UTC
rendered paste body
// auf deiner Buehne liegen 2 Mc's uebereinander
// dder s/w ueber dem farbigen!!
// der s/w heisst in diesem BSP bild2
// thats all


// linus@flashhilfe.de
// http://flashhilfe.de/impressum.html#tk

bild2.onRollOver = function() {
	alphaInt = setInterval(alphaFunc, 20, 5, "fadeout");
};
bild2.onRollOut = function() {
	alphaInt = setInterval(alphaFunc, 20, 5, "fadein");
};

function alphaFunc(wert, richtung) {
	if (richtung == "fadeout") {
		bild2._alpha -= wert;
		if (bild2._alpha<=0) {
			bild2._alpha = 0;
			clearInterval(alphaInt);
		}
	}
	if (richtung == "fadein") {
		bild2._alpha += wert;
		if (bild2._alpha>=100) {
			bild2._alpha = 100;
			clearInterval(alphaInt);
		}
	}
}