ActionScript Help: Conditional not working correctly

Hi I’m a newbie learning Actionscript and I’m trying to create a simple interface composed of two graphics an input text box and a button.

The code I’ve been able to come up with for the background (where the images are) is:

 
setProperty (_root.checkmark, _visible, 0); 
setProperty (_root.redx, _visible, 0);

And for the button I’ve put this code:

on (release) {
 var myNum:Number = answerbox.text;
 if ((myNum > 5) and (myNum < 8 )) {
  setProperty (_root.checkmark, _visible, 1); 
  }else {
   setProperty (_root.redx, _visible, 1);
   }
 }

No matter what, if anything I put in the input box only the red x graphic comes up.

Can someone give me some insight?