# ActionScript Help: Conditional not working correctly

**URL:** <https://forum.kirupa.com/t/actionscript-help-conditional-not-working-correctly/247358>\
**Category:** flash\
**Created:** [December 21, 2007, 7:20pm UTC](https://forum.kirupa.com/t/actionscript-help-conditional-not-working-correctly/247358 "2007-12-21T19:20:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![deadtrees](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@deadtrees](https://forum.kirupa.com/u/deadtrees)\
**Post date:** [December 21, 2007, 7:20pm UTC](https://forum.kirupa.com/t/actionscript-help-conditional-not-working-correctly/247358/1 "2007-12-21T19:20:55Z")

</div>

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:

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

```

And for the button I’ve put this code:

```auto
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?
