# Dynamically creat buttons from XML data

**URL:** <https://forum.kirupa.com/t/dynamically-creat-buttons-from-xml-data/61394>\
**Category:** programming\
**Created:** [August 18, 2004, 6:29am UTC](https://forum.kirupa.com/t/dynamically-creat-buttons-from-xml-data/61394 "2004-08-18T06:29:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![escapist](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/escapist/32/697_2.png) [@escapist](https://forum.kirupa.com/u/escapist)\
**Post date:** [August 18, 2004, 6:29am UTC](https://forum.kirupa.com/t/dynamically-creat-buttons-from-xml-data/61394/1 "2004-08-18T06:29:02Z")

</div>

I looked for an answer to this in the forum… forgive me if I missed it.

I’m building a site that draw it’ data from XML for the first time. Right now, all of the text and image paths are coming from an XML doc.

What I want is to be able to write something like a foreach loop that will create a series of menu buttons on the stage based on the number of child nodes in the XML node I specify. Each button should be offset horizontally from the previous one, and draw itself several frames after, to give a wave-like effect. Each button should also have the functionality to load XML data into a pre-existing textArea.

The site I’m working on is here: http://[jason-carlin.com](http://jason-carlin.com).  
The menu I want to build dynamically is the submenu (above the main menu) that appears after you click on WORK.

Any help is appreciated.

---

<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:** [August 19, 2004, 2:22am UTC](https://forum.kirupa.com/t/dynamically-creat-buttons-from-xml-data/61394/2 "2004-08-19T02:22:22Z")

</div>

I have been searching for months trying to find out how to do exactly what you want to do and have come up with nothing.

---

<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:** [August 19, 2004, 3:00am UTC](https://forum.kirupa.com/t/dynamically-creat-buttons-from-xml-data/61394/3 "2004-08-19T03:00:59Z")

</div>

Are you using ASP? You can do this with ASP and XSLT since you are using XML. Basically build your xml in a query string. It is real involved and hard to explain, but that should at least send you on your way.

---

<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:** [August 19, 2004, 3:45am UTC](https://forum.kirupa.com/t/dynamically-creat-buttons-from-xml-data/61394/4 "2004-08-19T03:45:12Z")

</div>

maybe that link is part of what your looking for:  
[http://www.actionscript.org/forums/showthread.php3?t=52684](http://www.actionscript.org/forums/showthread.php3?t=52684)

hope that helps,  
-zod

---

<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:** [August 22, 2004, 7:18pm UTC](https://forum.kirupa.com/t/dynamically-creat-buttons-from-xml-data/61394/5 "2004-08-22T19:18:39Z")

</div>

That is exatly what I was looking for. There were some subtle differences in my syntax that were keeping my code from working. Thanks so much for your help.

---

<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:** [August 22, 2004, 8:13pm UTC](https://forum.kirupa.com/t/dynamically-creat-buttons-from-xml-data/61394/6 "2004-08-22T20:13:25Z")

</div>

you’re very welcome :thumb:

- zod
