what im sure of is your second one is always going to return an ok value:
line = "a == 1"
for (i = 2; i<=5;i++){
line += " || a == " + i;
}
a = 1;
if (a == 1 || a == 2 || a == 3 || a == 4 || a == 5) {
trace("works")
}
since you tell flash that a=1 and then say if a ==1 then trace “works”
the problem is that:
line += " || a == " + i
it’s supposed to turn into a true of false argument, there it will turn into a string text since you have to brackets
try to do that:
line = "a == 1"
for (i = 2; i<=5;i++){
line += " || a == " + i;
// i added this line below, to check what
//the 'line' var becomes
trace(line)
}
a = 1;
if (line) {
trace("works")
}