Using a variable value

Hi there!

Please, first, promise not to laugh!

In the script, I wrote:
text_field.text = “yes”;
var a:String = text_field.text;

At the beginning of a conditional logic statement I want to use the value of this variable.
How should I write the condition?

I tried:
if (a == yes) {…
if (a = yes) {…
if (a == “yes”) {…
if (a.length = 3) {…

Nothing works…
Maybe I’m too tired and… confused!
Please, put me back on the track.

I thank you in advance.

Best regards from Old Gerry