# Function doesnt work

**URL:** <https://forum.kirupa.com/t/function-doesnt-work/121997>\
**Category:** Uncategorized\
**Created:** [September 9, 2004, 12:13pm UTC](https://forum.kirupa.com/t/function-doesnt-work/121997 "2004-09-09T12:13:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tedc](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@tedc](https://forum.kirupa.com/u/tedc)\
**Post date:** [September 9, 2004, 12:13pm UTC](https://forum.kirupa.com/t/function-doesnt-work/121997/1 "2004-09-09T12:13:30Z")

</div>

Hello everyone, I have posted already in the Flash MX 2004 forum, but I think there is best since this is something pretty basic. This is my first time creating a user defined function that actually will save me time for something, but it doesnt work! I think it should be pretty simple and I dont get any errors but it just doesnt do anything:

```auto

onClipEvent (load){
	function dropDown(section){
		dropdownmenuTarget = eval("_root.submenu_"+section);
		variableTarget = eval("_root."+section+"menuOver");
		buttonTarget = eval("_root."+section+"_button");
		
		if (buttonTarget.hitTest(_root._xmouse, _root._ymouse, true)) {
			buttonTarget.gotoAndStop(2);
			variableTarget = true;
			trace("on");
			
		} else if (dropdownmenuTarget.hitTest(_root._xmouse, _root._ymouse, true)) {
			buttonTarget.gotoAndStop(2);
			variableTarget = true;
			trace("Sub Menu On");
		} else {
			buttonTarget.gotoAndStop(1);
			variableTarget = false;
			trace("off");
		}
	}
}
onClipEvent (enterFrame) {
	dropDown(services);
}

```

If Im not mistaken, when I run the function with the parameter “services” it should read like this including the eval: \_root.services\_button.gotoAndStop(2); but really it doesnt do anything. :hurt: None of the commands work, as if the target was wrong but… well Im really confused… Any help would be GREATLY appreciated.

Ted
