In need of help with Fading Grid tutorial

Can anyone provide some help with the fading grid tutorial? I just can’t seem to get it to work. http://www.kirupa.com/developer/mx/fadegrid.htm

Any help is greatly appreciated.

-Joe

what seems to be the problem? are you able to load the mc?

Well, i followed the tutorial to the letter, but was unable to load the mc. You wouldn’t happen to have an example file I could look at or know of where one is would you?

Thanks,
Joe

here is a thread from actionscript.org:
http://www.actionscript.org/forums/showthread.php3?t=36287

the zip file should help you out.

good luck!

That looks like it will help out. Thanks!!

Here’s a link to the source file. Image is copyright of ElectronGeek, http://www.electrongeek.net.

http://www.voetsjoeba.com/upload/fadegrid.fla

Yeah i just tried it and it just sits there with the border, and never starts the animation to reveal the picture. I’m looking over it to make sure i did everything right. Anybody else had this problem and solved it? It’s a really cool effect though. Well i mean once it works…

EDIT–

Whoops looks like there were more posts while i was doing it, i’ll check those out.

Ok i’m getting this figured out, it’s pretty cool… but i’m trying to create a function where it will also go in reverse (where the image is visible, and then goes away). Fraid i’m pretty bad at math, i’ve been messing with it. What code in the Fade function determines whether the alpha goes up or down? I know when i find out i’ll feel real stupid. Thanks.

Try this code:


xunit = 27.7;
yunit = 27.7;
depth = 0;
box._visible = 0;
for (i=0; i<11; i++) {
	for (var k = 0; k<8; k++) {
		var cur = _root.box.duplicateMovieClip("box"+depth, depth);
		cur._x = _root.image._x+(xunit*i);
		cur._y = _root.image._y+(yunit*k);
		cur._alpha = 0;
		depth++;
	}
}
function continueFade(mc, speed) {
	mc.onEnterFrame = function() {
		this._alpha += speed;
		if (this._alpha>=100) {
			delete this.onEnterFrame;
		}
	};
}
function fadeMC(mcnr, speed) {
	_root["box"+mcnr].onEnterFrame = function() {
		this._alpha += speed;
		if (this._alpha>=10) {
			this.onEnterFrame = null;
			continueFade(this, speed);
			fadeOut(++mcnr, speed);
		}
	};
}
function fadeOut(startboxnr, speed) {
	fadeMC(startboxnr, speed);
}
fadeOut(0, 5);

:slight_smile:

Thanks Voetsjoeba, i’ve been messing with it some. It works, but something funny happens towards the end of the block fading where it skips a few blocks, but i’ll figure it out, just wanted to thank you for the help.