# Newbie help: Create/Run Functions from xml attribute?

**URL:** <https://forum.kirupa.com/t/newbie-help-create-run-functions-from-xml-attribute/293798>\
**Category:** flash\
**Created:** [August 4, 2009, 5:28am UTC](https://forum.kirupa.com/t/newbie-help-create-run-functions-from-xml-attribute/293798 "2009-08-04T05:28:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![adlib33](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@adlib33](https://forum.kirupa.com/u/adlib33)\
**Post date:** [August 4, 2009, 5:28am UTC](https://forum.kirupa.com/t/newbie-help-create-run-functions-from-xml-attribute/293798/1 "2009-08-04T05:28:32Z")

</div>

Is it possible to pull a function (and run it) from an xml attribute?

I have a dynamic xml menu with lots of buttons and sub buttons

```auto

function subButtnClick(........

if(String(_xml.item[_off.parent.id].subitem[_subOff.parent.id].@fn) != ""){

trace(String(_xml.item[_off.parent.id].subitem[_subOff.parent.id].@fn)); //returns the fn attribute - in this case, "aboutUs()" - when the "about Us" sub button is clicked. 

}

```

How can I take that string value of “aboutUs()” and make it run as an actual function within that same if statement?

What I’d love to do is place a boat load of functions that each allow me to manipulate the stage in different ways - creating different page looks - on a separate imported “menuFunctions.as”. Each menu button click returns the “fn” xml attribute which is then magically run as a particular function from menuFunctions.as, finally then, manipulating the main stage.

Is this possible? Is there a better way? I really like this little menu but it wasn’t built to manipulate the flash stage rather take you to another URL.

New to As3…and programming in general…having a hard time.  
Hope someone can help or point me in the right direction…  
Thanks
