Duplicating button

I’m trying to duplicate a button using action script

(for mc)
onClipEvent (load)
{
maxDepth=1000;
z=Math.round(Math.random()maxDepth);
fl=300;
xcenter=175;
ycenter=175;
offx=(startx-xcenter);
offy=(starty-ycenter);
scale=fl/(fl+z);
_x=xcenter+offx
scale;
_y=ycenter+offyscale;
_xscale=_yscale=100
scale;
}

(for root)
nbClip=50;
for (i=0;i<nbClip;i++){
duplicateMovieClip(ball,“ball”+i,i);
mc=_root[“ball”+i];
mc.startx=Math.round(Math.random()*300)-50;
mc.starty=Math.round(Math.random()*300)-50;
}

So far the button is placed randomly but it isn’t being duplicated

what am i doing wrong ohh and yes this is one of the tutorials but isn’t explained.

you should be using a movie clip…not a button…MX allows mc’s to have properties of buttons…so yeah…u can do that…

i am using a movie clip i guess i should have mentioned that should i try something else

HA HA HA HA HA

i figured it out. i had to type ball in the instance name as well. now the duplication works