Dynamically creating buttons?

Hello. I’m using Flash CS3, Actionscript 2.0 and I’m trying to create buttons dynamically.

I tried to follow the code in the link below.

http://www.kirupa.com/forum/showthread.php?t=7574&highlight=create+buttons+dynamically

The code is correct for the most part but the only problem I have is that only the last button appears. For example, if I try to create 10 buttons, only the 10th button is created.