# Function Not Working

**URL:** <https://forum.kirupa.com/t/function-not-working/205766>\
**Category:** flash\
**Created:** [November 1, 2006, 6:48pm UTC](https://forum.kirupa.com/t/function-not-working/205766 "2006-11-01T18:48:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SlowRoasted](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@SlowRoasted](https://forum.kirupa.com/u/SlowRoasted)\
**Post date:** [November 1, 2006, 6:48pm UTC](https://forum.kirupa.com/t/function-not-working/205766/1 "2006-11-01T18:48:28Z")

</div>

I don’t get why my menu dropdown function is not working. It works when I put the instance name of the dropdown menu in, but when I try to use eval for the instance name it won’t work. This code is giving me the problem.

```auto

menuopen(eval("d"+q), -219, 0);

```

This is most of my AS

```auto

//////////////////////
///Button Functions///
//////////////////////

function menuclose(item, beg, end) {
	var butclose:Tween = new Tween(item, "_y", Strong.easeOut, beg, end, .3, true);
	var maskclose:Tween = new Tween(eval(item+"mask"), "_y", Strong.easeOut, beg, -225, .3, true);
	clearInterval(dropup1);
};

function menuopen(item, beg, end) {
	var butopen:Tween = new Tween(item, "_y", Strong.easeOut, beg, end, .3, true);
	var maskopen:Tween = new Tween(eval(item+"mask"), "_y", Strong.easeOut, beg, end, .3, true);
};

function butup(item) {
	if(dropup1 != null){
		clearInterval(dropup1);
	}
	var butin:Tween = new Tween(item, "_alpha", Strong.easeOut, 0, 12, .5, true);
};

function butdown(item) {
	var butin:Tween = new Tween(item, "_alpha", Strong.easeOut, 12, 0, .5, true);
};

////////////////////
///Button Actions///
////////////////////

//Buttons on the main nav bar
var q:Number = 1;

b1.onEnterFrame = function(){
	
	eval("b"+q).onRollOver = function() {
	butup(this);
	menuopen(eval("d"+q), -219, 0);
	};

	eval("b"+q).onRollOut = function() {
	butdown(this);
	dropup1 = setInterval(menuclose, 1000, eval("d"+q), 0, -225);
	};

	eval("b"+q).onReleaseOutside = function() {
	butdown(this);
	dropup1 = setInterval(menuclose, 1000, eval("d"+q), 0, -225);
	};

	q++;

	if(q == 3){ delete this.onEnterFrame; }
}

```
