Detect empty input textfield

how could i detect empty input textfield?

if (txt.text == “”) {
trace(“blank”);
}
if (txt.text != “”){
trace(“not blank”);
}

not working :’( help me plss…