Xml/AS2 dropdown menu

I have included the files I’m working with in this post for anyone who wants to take a look. (You’ll have to look at these files to understand what I’m talking about because I’m sure it makes no sense without it)

I am creating an xml / actionscript driven navigation for my site. I have two levels of navigation - the main nav and the sub nav.

You’ll notice the first 4 main menu items span the width of the file - but when you roll over the first two buttons on the main nav, the sub nav comes up and goes off the page because there are 8 sub menu items - when there is really only room for 4. This is because every button in the file is using a fixed width (whether the subnav word is 20 characters long or 5 characters long - the whole button is always 50 characters long).

My question is:
Is it possible to make the buttons change width depending on the length of the characters within the button? For instance the button “Professional One” would be a longer width button than the button “One” - each would have a 10px padding on either side. If it is possible, how do I do it?

I appreciate any help anyone can give me.