I am seeing a strange issue in flex. I need to reset all text input fields to 0 once the
user submits the values to be calculated. In the method
private function calculate():void {
resetToZero();
var num:Number = parseFloat(s21.text);
}
private function resetToZero():void {
//multiple if statements.... existing here..
if(s2l.text.length ==0);
{
Alert.show("length is:" + s2l.text.length);
s2l.text="0";
}
}
When I am running the program I am getting the alert – length is 1. How is that it when length is 1 it is entering the if statement?. The behavior is really confusing and need some light on this. Is there any other way to achieve the above functionality?
Its because of IF statement, which is terminated
Remove ; from end as
Hopes that helps