Making boxes appear 1 by 1

if you say so :stuck_out_tongue: I tried the last code you gave me, but it still doesnt’ seem to attach to the correct spot? It always ends up starting at the bottom of the screen :-\

And i was also wondering why need a startx and starty if the movieclip you attach it to will be the starting point?? thanks!

This creates a grid of smooth infading boxes. The box is in the library, and is exported in first frame with the linkageID “box”. It’s width is 27.8(to guarantee a nice positioning). If you want the boxes to appear one by one instead of a trail, change smoothness to 0 =)

[AS]xunit = 27.7;
yunit = 27.7;
xoffset = 20;
yoffset = 20;
depth = 0;
azcount = 0;
smoothness = 99;
for (i=0; i<11; i++) {
for (var k = 0; k<8; k++) {
attachMovie(“box”, “box”+depth, depth);
cur = this[“box”+depth];
cur._x = xoffset+(xuniti);
cur._y = yoffset+(yunit
k);
cur._alpha = 0;
depth++;
}
}
function continueFade(mc, speed) {
mc.onEnterFrame = function() {
mc._alpha += speed;
if (mc._alpha>=100) {
delete mc.onEnterFrame;
}
};
}
function fadeMC(mcnr, speed) {
_root[“box”+mcnr].onEnterFrame = function() {
_root[“box”+mcnr]._alpha += speed;
if (_root[“box”+mcnr]._alpha>=100-smoothness) {
_root[“box”+mcnr].onEnterFrame = null;
azcount++;
continueFade(_root[“box”+mcnr], speed);
mcnr += 1;
fadeIn(mcnr, speed);
}
};
}
function fadeIn(startboxnr, speed) {
fadeMC(startboxnr, speed);
}
fadeIn(0, 5);[/AS]

thanks voets…i was just lookin at the code now but i can’t seem to find the code which makes it change to the next column??! i think i am missing something :-\

The code creates a grid of invisible boxes then fades them in. The boxes have the instance names box0,box1,box2… So the grid will look like

0 10 20
1 11 21
2 12 22
3 13 23
4 14 24
5 15 25
6 16 26
7 17 27
8 18 28
9 19 29

And it starts fading out at box 0 and continues until the maximum, so since the following of the ones at the bottom are the ones at the top of the next column, it will change column.

:-\ sorry i’m confused…how does it automatically change columns??! :-\

Err … I just told ya :stuck_out_tongue: I don’t know if I can explain differently, but I’ll try. So the boxes have the instance names box1,box2, and so on right ? The boxes are placed in columns and rows by the grid, and they are set up the way I told you above. The code fades them out one by one, like box0, box1, box2 … It just follows the order, and since the grid set them up the way it did, it changes column. Well it doesn’t change column actually, it just continues with the next box, which is the beginning of the following column.

OOh…i see now! weird how they could be set up like that :stuck_out_tongue: i’m gonna see if i can swap em around a bit see if i’m good enough :slight_smile:

If not, read the third page of my tutorial :wink:

got it on my own :stuck_out_tongue: Thanks zylum and voets. I have decided to use voets since it is more of your level but thanks for everythin!!!

You’re welcome :wink: