# Totally Dynamic Flash Menu

**URL:** <https://forum.kirupa.com/t/totally-dynamic-flash-menu/154872>\
**Category:** flash\
**Created:** [July 13, 2005, 8:34am UTC](https://forum.kirupa.com/t/totally-dynamic-flash-menu/154872 "2005-07-13T08:34:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Silmano](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/silmano/32/1479_2.png) [@Silmano](https://forum.kirupa.com/u/Silmano)\
**Post date:** [July 13, 2005, 8:34am UTC](https://forum.kirupa.com/t/totally-dynamic-flash-menu/154872/1 "2005-07-13T08:34:26Z")

</div>

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:

```auto
 
<?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:
