# Help with paths

**URL:** <https://forum.kirupa.com/t/help-with-paths/292931>\
**Category:** Uncategorized\
**Created:** [July 21, 2009, 1:00am UTC](https://forum.kirupa.com/t/help-with-paths/292931 "2009-07-21T01:00:23Z")\
**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:** [July 21, 2009, 1:00am UTC](https://forum.kirupa.com/t/help-with-paths/292931/1 "2009-07-21T01:00:23Z")

</div>

My main question is about paths - from the menu.as through the main stage to running a function on the other as file.

I have a dynamic xml menu. The menu is in a class file. Great menu but I’m trying to add functionality.

Right now, if I press any button or sub button, it takes me to another URL. Problem is that, instead of going to another address, I want that button press to run a particular function on the main stage. In an ideal world I would put all of these particular functions on a separate class file with each function making the stage do various things - i.e. add/remove particular children, move MC’s around, add swfs, etc.

Can this be done? Should this be done?

something like

```auto
//function on menu.as

function makeSomethingHappen(event.MouseEvent):void
{
//find the particular clicked button
var buttonClicked = _xml.item[e.target.parent.id]//this works - gives me something like //"about"
 //I know this is a reach. 
this.parent.buttonClicked+"()"; //????
}

```

What I’m trying to do is get the menu item id and use that item id to dynamically run a specific function with the same name sitting on another separate .as file.

Is this crazy complicated when there is an easier something to do instead?
