# Re-Evaluate Variables in a Conditional Loop

**URL:** <https://forum.kirupa.com/t/re-evaluate-variables-in-a-conditional-loop/317372>\
**Category:** flash\
**Created:** [December 18, 2010, 1:03am UTC](https://forum.kirupa.com/t/re-evaluate-variables-in-a-conditional-loop/317372 "2010-12-18T01:03:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![snotice](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@snotice](https://forum.kirupa.com/u/snotice)\
**Post date:** [December 18, 2010, 1:03am UTC](https://forum.kirupa.com/t/re-evaluate-variables-in-a-conditional-loop/317372/1 "2010-12-18T01:03:59Z")

</div>

Ive racked my brain on this one and I just cant seem to see what im doing wrong.

I have 2 text boxes that need to be evaluated against each other.  
Both are input boxes that capture and store data into variables. I just want to  
compare those values and run the proper code.

It works fine for the first round. If I enter new values, the variables are updated as well. But the new values are not applied to the condition the second time around.

> var requested: Number = input\_txt1.text;  
> var total: Number = input\_txt2.text;

btn\_mc.onMouseUp = doPress;

function doPress () {  
var requested: Number = input\_txt1.text;  
var total: Number = input\_txt2.text;  
trace (input\_txt1.text);  
trace (input\_txt2.text);

```
if (total&lt;requested) {
    trace ("if statement 1");}
    trace (input_txt1.text);
    trace (input_txt2.text);        
    
if (requested&lt;total) {
    trace ("if statement 2");}
    trace (input_txt1.text);
    trace (input_txt2.text);        

```

};  
Can you see where I went wrong?
