Making a cascade of diagonal lines

Okay. So, I’m not really a script guy, but I’m plugging along learning the tricks of the trade. I’m fairly comfortable with JS and getting there with AS, but I’m having some problems with the syntax in certain areas.

I need to create a set of diagonal lines for a piece of a design I’m working on right now.

To do this, I have tried using the following code for duplicating the original diagonal movie clip, entitled: 'diag":

// Duplicate Movie Code
onClipEvent (load) {
var oldY = this._y;
}
onClipEvent (enterFrame) {
amount = 47;
while(amount>0) {
duplicateMovieClip (_root.maincontent.diagonals, “diag” + i, i);
i = i + 1;
amount = amount-1;
oldY = oldY + 5;
}
}

I have done the math to figure how many times the diagonal needs to be duplicated, but I’m guessing that even THAT is a hack to some degree. How far off am I? Is this TOTALLY wrong?

Any help would be greatly appreciated,

Thanks,
Greg Huntoon

Hey,
I’m at work (and bored) and so I don’t have flash here to try it. I think your problem is that you do not define the first coor (x,y). On your load event handler, you should have where the first line is going to be:
[AS]
onClipEvent(load){
_x=300;
_y=450;
oldy=this._y;
}
[/AS]
So, I would try that first. If you still don’t get it, post and I’ll look at it when I get home.
Good luck!
(-:

Here’s my crack at it. This code can go in the first frame of the timeline:

[AS]_root.maincontent.diagonals.onLoad = function () {
oldY=5;
for (i=0; i<47; i++) {
duplicateMovieClip (_root.maincontent.diagonals, “diag” + i, i);
_root[“diag” + i]._y += oldY;
oldY += 5;
}
}[/AS]

that should work.

I’m going to check this out later. It’s not essential to my deadline tomorrow, but I’m going to use this in the next couple of days.

Thanks for the super-speedy responses,
Greg