I'm strictly guessing ( I don't do Actionscript but JS ), but if your i
variable stays the same then you'll need to use closures to capture and bind that i
in place:
function resetAll(menuNum){
trace(menuNum);
for (i=0; i<=7; i++){
(function(i){
if(menuNum != 1){
menu_all_mc.this["btn_"+i].gotoAndStop("off");
}
})(i);
}
}
Let me know if that doesn't work. Also make sure the this
keyword is referencing the correct execution context.
Edit: the this
can't be referenced like that, are you sure it's not just menu_all_mc["btn_" +i]
? this
isn't a property of an object unless you explicitly define it as such.
o = {};
trace( o.this==undefined )
would evaluate to true because it was never defined. this
in a function scope will refer to the current execution context but do not prefix it with another object.
Can you clarify what object owns the .btn1, etc?