# Input textbox problem

**URL:** https://forum.kirupa.com/t/input-textbox-problem/312183
**Category:** Uncategorized
**Created:** [July 27, 2010, 4:51pm UTC](https://forum.kirupa.com/t/input-textbox-problem/312183 "2010-07-27T16:51:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![blackout188](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@blackout188](https://forum.kirupa.com/u/blackout188)
#### Post date: [July 27, 2010, 4:51pm UTC](https://forum.kirupa.com/t/input-textbox-problem/312183/1 "2010-07-27T16:51:08Z")

</div>

if the user’s input matches the value in the random array index then it traces true. even after I entered the right answer the trace is still false, can someone help me with this please. Thank you

var possible:Array=new Array()  
var questionran:int  
var plusran:int  
var checker:int  
questionran=Math.random()\*12+1  
if(questionran==1){  
plusran=Math.random()\*6+1  
questionran=questionran+plusran  
}  
trace(questionran)  
possible[12]=1  
possible[11]=2  
possible[10]=3  
possible[9]=4  
possible[8]=5  
possible[7]=6  
possible[6]=5  
possible[5]=4  
possible[4]=3  
possible[3]=2  
possible[2]=1

questionone.text="Suppose two dice are rolled and you want the sum of the two dice to be “+” “+String(questionran)+” "+  
“How many ways can this occur?”  
check1\_btn.addEventListener(MouseEvent.CLICK,checking)  
function checking(e:MouseEvent){  
switch(e.currentTarget){  
case check1\_btn :  
checker=possible[questionran]  
trace(checker)  
if(input1.text==String(checker)){  
trace(“correct”)  
}  
else{  
trace(“wrong”)  
trace(input1.text)  
}  
}  
}
