# The grid effect problem

**URL:** <https://forum.kirupa.com/t/the-grid-effect-problem/33528>\
**Category:** Uncategorized\
**Created:** [October 20, 2003, 7:17pm UTC](https://forum.kirupa.com/t/the-grid-effect-problem/33528 "2003-10-20T19:17:44Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![E\_vOl](https://avatars.discourse-cdn.com/v4/letter/e/5f9b8f/32.png) [@E\_vOl](https://forum.kirupa.com/u/E_vOl)\
**Post date:** [October 20, 2003, 7:17pm UTC](https://forum.kirupa.com/t/the-grid-effect-problem/33528/1 "2003-10-20T19:17:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 20, 2003, 7:20pm UTC](https://forum.kirupa.com/t/the-grid-effect-problem/33528/2 "2003-10-20T19:20:27Z")

</div>

Use this code:

```auto

//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);

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 20, 2003, 7:27pm UTC](https://forum.kirupa.com/t/the-grid-effect-problem/33528/3 "2003-10-20T19:27:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 21, 2003, 5:03pm UTC](https://forum.kirupa.com/t/the-grid-effect-problem/33528/4 "2003-10-21T17:03:20Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 21, 2003, 5:42pm UTC](https://forum.kirupa.com/t/the-grid-effect-problem/33528/5 "2003-10-21T17:42:40Z")

</div>

ei where can i find that grid effect…?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 21, 2003, 5:44pm UTC](https://forum.kirupa.com/t/the-grid-effect-problem/33528/6 "2003-10-21T17:44:49Z")

</div>

Here: [http://www.kirupa.com/developer/mx/fadegrid.htm](http://www.kirupa.com/developer/mx/fadegrid.htm) 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 21, 2003, 5:47pm UTC](https://forum.kirupa.com/t/the-grid-effect-problem/33528/7 "2003-10-21T17:47:00Z")

</div>

thanks man!!! 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 22, 2003, 8:00am UTC](https://forum.kirupa.com/t/the-grid-effect-problem/33528/8 "2003-10-22T08:00:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 22, 2003, 10:37am UTC](https://forum.kirupa.com/t/the-grid-effect-problem/33528/9 "2003-10-22T10:37:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 22, 2003, 5:45pm UTC](https://forum.kirupa.com/t/the-grid-effect-problem/33528/10 "2003-10-22T17:45:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 22, 2003, 6:06pm UTC](https://forum.kirupa.com/t/the-grid-effect-problem/33528/11 "2003-10-22T18:06:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 22, 2003, 10:10pm UTC](https://forum.kirupa.com/t/the-grid-effect-problem/33528/12 "2003-10-22T22:10:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 22, 2003, 10:13pm UTC](https://forum.kirupa.com/t/the-grid-effect-problem/33528/13 "2003-10-22T22:13:47Z")

</div>

sorry forgot the grid file.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 23, 2003, 5:22pm UTC](https://forum.kirupa.com/t/the-grid-effect-problem/33528/14 "2003-10-23T17:22:04Z")

</div>

I’m not getting mad 🙂

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 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 30, 2003, 12:15pm UTC](https://forum.kirupa.com/t/the-grid-effect-problem/33528/15 "2003-10-30T12:15:36Z")

</div>

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](http://www.triple5soul.com/site/index.html)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 30, 2003, 12:24pm UTC](https://forum.kirupa.com/t/the-grid-effect-problem/33528/16 "2003-10-30T12:24:29Z")

</div>

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 😉
