For (i=0;i=done;i++) {messed up}

I have two “for” statements in a row in one frame, which duplicate two different movies. First one creates 7 copies of one movie and the second one creates 30 copies of another movie. When I write the first one only it duplicates 7 movies, works fine. When i write the second one it works properly but the first one stops working. The question is:

Why:q:

Here’s the code if needed:

weekdays = new Array ("Su","Mo","Tu","We","Th","Fr","Sa")
now = new Date();
weekd._x = -25;
ox = weekd._x * -1;
days._x = -25;

for (i = 0;i<weekdays.length;i++) {
	_root.weekd.duplicateMovieClip("weekd"+i,i);
	_root["weekd"+i]._x = ox * i + 30;
}
for (j = 1;j<31;j++) {
	_root.days.duplicateMovieClip("days"+j,j);
	_root["days"+j]._x = ox2 * j + 30;
}

because you put movieclips in the same depth

it goes like:

1st “for” creates movies on depths 1, 2, 3, 4, 5, … and so on

and the 2nd “for” creates movies on depths 1, 2, 3, 4, 5 as well

it collides with each other and the old one is being replaced with new one

simple

[AS]
weekdays = new Array (“Su”,“Mo”,“Tu”,“We”,“Th”,“Fr”,“Sa”)
now = new Date();
weekd._x = -25;
ox = weekd._x * -1;
days._x = -25;

for (i = 0;i<weekdays.length;i++) {
_root.weekd.duplicateMovieClip(“weekd”+i,i);
_root[“weekd”+i]._x = ox * i + 30;
}
for (j = 1;j<31;j++) {
_root.days.duplicateMovieClip(“days”+j,j + weekdays.length);
_root[“days”+j]._x = ox2 * j + 30;
}
[/AS]

this way the weekday MCs will take up depths 0 - 6 and days will take up 7 - 36.

Duh! Thanx guys :thumb:

n/p