I am trying to set the alpha value of a MC according to the value of a variable.
The variable is in the form strVar(i).
If the variable matches a set value, then set the alpha to 50%, otherwise set it to 0%.
Here is the code I am using, but it always sets the value of x to 1, indicating that the first if statement is always true, when in fact it is not.
Does anyone have any ideas how to correct this?
onClipEvent (load) {
for (i=1; i<=strVar0; i++) {
if (["strVar"+i] == "Facilities Design"
{
x = 1;
}
}
if (x=1) {
this._alpha = 50;
} else {
this._alpha = 0;
}
}
The variable is in the form strVar(i).
If the variable matches a set value, then set the alpha to 50%, otherwise set it to 0%.
Here is the code I am using, but it always sets the value of x to 1, indicating that the first if statement is always true, when in fact it is not.
Does anyone have any ideas how to correct this?
onClipEvent (load) {
for (i=1; i<=strVar0; i++) {
if (["strVar"+i] == "Facilities Design"
x = 1;
}
}
if (x=1) {
this._alpha = 50;
} else {
this._alpha = 0;
}
}