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.
menuopen(eval("d"+q), -219, 0);
This is most of my AS
//////////////////////
///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; }
}