Type comparisons between text field string values and integers can be bothersome as an empty string would trace as 0. Undeclared integers always default to zero.
textfield.text = ""; trace(int(textfield.text)); // 0
If you need to check whether a textfield is empty or if it contains the number zero, use a boolean.
if(Boolean(textfield.text)) { // textfield contains some input if(textfield.text == "0") { // textfield contains the zero character } }