# If Variable == number action should happen

**URL:** <https://forum.kirupa.com/t/if-variable-number-action-should-happen/279419>\
**Category:** Uncategorized\
**Created:** [January 14, 2009, 3:47pm UTC](https://forum.kirupa.com/t/if-variable-number-action-should-happen/279419 "2009-01-14T15:47:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PHD2B](https://avatars.discourse-cdn.com/v4/letter/p/958977/32.png) [@PHD2B](https://forum.kirupa.com/u/PHD2B)\
**Post date:** [January 14, 2009, 3:47pm UTC](https://forum.kirupa.com/t/if-variable-number-action-should-happen/279419/1 "2009-01-14T15:47:49Z")

</div>

In the attached CS4 file I have attempted to have a button evaluate whether a variable (textbox) is equal to a number. If so, I want another textbox to say “correct” or trace “correct” either way. However, it doesnt appear to be evaluating the variable. I receive the “correct” trace everytime the button is released. I would greatly appreciate anyone looking at this and giving me some advice.

I tried to upload the file but it is too large. The code in the button is as follows:

on (release){  
if (phoneNumber == “911”);  
trace (“correct”);  
}  
I have a textbox entitled numbers, in which the user presses buttons and the number is added to the textbox. The same textbox has a variable assigned to it entitled phonenumber. When the talk button is pressed the code above should check the variable to see if it == 911. However no matter what I enter into the textbox, the trace always pops up and says correct.

Please advise.

Jeff
