How do you make dynamic buttons in Flash?

I am trying to create my first Flash website for my wife’s cousin (she’s a photographer).

I want to have navigation buttons that are dynamically created. For example I can use XML, PHP, etc to read folders from the server and it thus creates those choices under the menu button.

Example: Under her Gallery section button when I click it I want it to show me: Babies, Weddings, Portraits, etc as sub-buttons under this main button. The names of this are found from folder names on server. How would I do this?

Also say I want the buttons to do some special animation do I first create a template of a button in flash that behaves how I want it (fading in, stretchiing, etc) and then somehow my XML/PHP/etc can inherit these properities when its creating multiple buttons dynamically on the fly?

Thanks.