Duplicate Movie Clips

I would like to[font=Verdana][size=2]have duplicate movie clips appear automatically when an animation loads. I’d gone through the [/size][/font][font=Verdana][size=2]duplicate movie clips tutorial, but it just could not work. Do I need to add more in the Frame besides

[/size][/font]

amount = 50;
                         while(amount>0) {
                         duplicateMovieClip (target, new                        mc name, mc depth);
                         i = i + 1;
                         amount = amount-1;
                      }

?

By the way, I’m using flash mx. Please help, thanks.