I’ve done a dynamic XML Flash menu that works like a charm, BUT since the data of the XML file have different length for every sub menu, I wanted to know how can I make the menu also dynamic.
Long explanation of the problem
I have a file like this:
<?xml version="1.0" encoding="UTF-8"?>
<mainMenu>
<menu name="Whatever">
<sub name="Misión"/>
<sub name="AnotherItem"/>
<sub name="Such a big item length"/>
<sub name="Contact"/>
<sub name="Empleo"/>
</menu>
<menu name="Method">
<sub name="Whatever Business"/>
<sub name="Method"/>
</menu>
</mainMenu>
The thing is that since “Such a big item length” and “Whatever Business” are longer than the other items in the sub menu, they dont really fit well on it.
To build the menu, I’m using a MC of 100x20. So, what I wanted to know is IF I can change its dimensions from AS acording to text length or what solution do I have to my problem?
A solution I’ve think about, but I dont know how to implement it, is to create a MC of 1x20 pix (WxH) and use AS to resize/tween it to get the apropiate width to be able to fit the entire text.
Here is a graphic to show what I have and what I want: