# Building Dynamic Menu

**URL:** <https://forum.kirupa.com/t/building-dynamic-menu/64587>\
**Category:** flash\
**Created:** [September 17, 2004, 5:37pm UTC](https://forum.kirupa.com/t/building-dynamic-menu/64587 "2004-09-17T17:37:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bjory](https://avatars.discourse-cdn.com/v4/letter/b/5e9695/32.png) [@bjory](https://forum.kirupa.com/u/bjory)\
**Post date:** [September 17, 2004, 5:37pm UTC](https://forum.kirupa.com/t/building-dynamic-menu/64587/1 "2004-09-17T17:37:30Z")

</div>

Hi guys, I have managed to get data out from Mysql database.

All it returns to me are:

1. Name of the button
2. Where it link to
3. Number of Buttons for the menu

So now, how can I build a menu of buttons such that I can display according to the database return on the number of buttons?

Can someone point me to the exactly codes on how I should do it?

I have already create a movieclip which is the image of a single button. With dynamic text on top of the button in the movieclip.

I just need to loop it thru the number of buttons and display the buttons on screen. But i can’t seems to get it right.

I have looked through the XML dynamic menu but it’s not very similar to mine as I’m using PHP script to connect to the database.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 17, 2004, 10:21pm UTC](https://forum.kirupa.com/t/building-dynamic-menu/64587/2 "2004-09-17T22:21:46Z")

</div>

//Nb = Name of the button  
[//mc.Nb](https://mc.Nb) = new mc w/ Nb in it.  
//li = Where it link to  
//nM = Number of Buttons for the menu  
var nM:Number = 5;  
var li:String = “[http://www.cnn.com](http://www.cnn.com)”;  
for (var x = 0; x\<nM; x++) {  
mc.duplicateMovieClip(“mc”+x, this.getNextHighestDepth(), {\_x:mc.\_x, \_y:mc.\_y+20\*x});  
\_root[“mc”+x].onRelease = function() {  
getURL(li, “\_blank”);  
};  
}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 17, 2004, 10:23pm UTC](https://forum.kirupa.com/t/building-dynamic-menu/64587/3 "2004-09-17T22:23:34Z")

</div>

an fla

> [@bjory](#):
>
> Hi guys, I have managed to get data out from Mysql database.
> 
> All it returns to me are:
> 
> 1. Name of the button
> 2. Where it link to
> 3. Number of Buttons for the menu
> 
> So now, how can I build a menu of buttons such that I can display according to the database return on the number of buttons?
> 
> Can someone point me to the exactly codes on how I should do it?
> 
> I have already create a movieclip which is the image of a single button. With dynamic text on top of the button in the movieclip.
> 
> I just need to loop it thru the number of buttons and display the buttons on screen. But i can’t seems to get it right.
> 
> I have looked through the XML dynamic menu but it’s not very similar to mine as I’m using PHP script to connect to the database.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 18, 2004, 5:04am UTC](https://forum.kirupa.com/t/building-dynamic-menu/64587/4 "2004-09-18T05:04:16Z")

</div>

Heres my .fla file. Doesn’t seems to work for me.
