Set interval help

I want to attack a movieclip every second, ive tried having a go at added adding a set interval command, but i cant get it to work.
Here’s ma code

attach = function () {
for (i=0; i<40; i++) {
repeat = this.attachMovie(“ball”, “ball”+i, i);
repeat._x = ((i3)+30);
repeat._y = ((i
repeat._rotation = (20*(i*2));

I can get it to attach them all at once, but i cant get it to do it one by one