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?
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!
(-: