Function doesnt work

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:


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

mmmm no one knows? Shouldnt this be relatively simple for you hardcore actionscripters? :{

attach ya fla dude

It wouldnt really change anything, the only thing I have is a menu system, and with 3 mc’s one dj :cowboy: (and one variable)the first mc is the controller that is outside the stage and has the ascript on it, the second is a sub menu that opens and closes according to the boolean value of the variable and the third mc is used for a button. That function should work no?
ok now that I think about it Im uploading the fla. :pa:

I really need help with this cause I like need to finish this project and I dont want to repeat the same functions for every button.

heres the fla: work.tedconn.com/home.fla

Dont have mx2004 to open it…
But taking a quick look at the code, i think you should remove the "'s in the target lines (“root.submenu”+section) etc.

right?