The grid effect problem

Hi well I did the grid effect and it worked fine but the problem is I want the grid(swf file) to load in the main movie I am doing. The problem is when I test it only a white box shows up. It doesn’t show the grid.

here it what I put in the key frame in the timeline

loadMovie(“grid 1.swf”, “container”);

it just doesn’t show. Is there something wrong I did. Can somebody give me a helping hand please.

Use this code:


//Declare variables
xspacing = box._width;
yspacing = box._height;
depth = 0;
box._visible = 0;
azcount = 0;
smoothness = 90;
//Calculate positions and values
amH = Math.ceil(image._width/box._width);
amV = Math.ceil(image._height/box._height);
border._height = image._height+1;
border._width = image._width+1;
border._x = image._x-0.5;
border._y = image._y-0.5;
//Create grid
for (i=0; i<amH; i++) {
	for (var k = 0; k<amV; k++) {
		box.duplicateMovieClip("box"+depth, depth);
		cur = this["box"+depth];
		cur._x = image._x+(xspacing*i);
		cur._y = image._y+(yspacing*k);
		depth++;
	}
}
// 
// 
// End of grid
// 
// 
function fadeOut(startboxnr, speed) {
	fadeMC(startboxnr, speed);
}
function fadeMC(mcnr, speed) {
	azcount++;
	this["box"+mcnr].onEnterFrame = function() {
		this._alpha -= speed;
		if (this._alpha<=smoothness) {
			this.onEnterFrame = null;
			continueFade(this, speed);
			mcnr += 1;
			fadeOut(mcnr, speed);
		}
	};
}
function continueFade(mc, speed) {
	mc.onEnterFrame = function() {
		this._alpha -= speed;
		if (this._alpha<=0) {
			delete this.onEnterFrame;
		}
	};
}
fadeOut(0, 5);

I think i didn’t explain my self right, sorry about that. The grid effect works fine and when I test that file it works. I want the grid swf.file to load into a different file. now when I test that movie everything else show accept the grid swf. file.

I hope that helps alittle.

Yeah I know, that’s because I accidentally used absolute addressing in a piece of the code. I’ve posted the code that uses relative addressing, so try it and it should work :slight_smile:

ei where can i find that grid effect…?

Here: http://www.kirupa.com/developer/mx/fadegrid.htm :slight_smile:

thanks man!!! :slight_smile:

how can i make it diagonally? and do you know by any chance a tut to make that “silver tube” thing on the picture…? ehehe

Silver tube ? Ooh, the image … that’s an image EG made. I really liked it and I asked if I could use it for the effect.

Voets hey I got confused. That is the code to make the grid effect and that works fine. Let me see how to explain this I am not explaining it right and thats my bad, so here I go.

2 swf files. Main & Grid effect. ok I published the grid effect and I got the grid.swf file. In the main movie I placed a empty MC. where I want the grid effect to load. when the time line gets to that place, lets say in frame 3 I want it to play the swf.file. In that keyframe, on the timeline I put this action to it

loadMovie(“grid.swf”, “container”);

ok now when I save and test the movie where the grid is suppose to load only a white box appears. That is what I need help with why is that happeing instead of playing the grid.swf like is suppose to.

Well as I said, that code should fix it. If not, then can I see both your FLA’s ?

here you go but dont get mad. its just that i am new to this thats all. this is the main movie called it crap because that is were everything I learn I do.

sorry forgot the grid file.

I’m not getting mad :slight_smile:

I took a look at your files, but I didn’t find a movieclip to load the grid.swf in. You’re using loadMovie(“grid.swf”,“container”);, but there is no movieclip called container. So I created one, loaded grid.swf into it and it works fine now :slight_smile:

ei Voetsjoeba …what if i would like the effect to do like in this site …where one row simultaneously appear from right to left, and not like one by one…

and it even shows a random pic everytime u visit…how’d they do that…

site

You could, instead of making boxes, make rows, then fade those rows out. You’d need to change a few things to the script, but that isn’t too hard :wink: