View Single Post
Old 04-04-2008, 18:32   #6 (permalink)
organicfiction
actioncodemonkey
 
Join Date: Dec 2007
Posts: 22
Hey gilbs your problem comes from the way flash handles data from textfields. Your code is solid enough so it should work if you change it abit like this:

Code:
start_btn.onRelease = function () { var ran1=Math.ceil(Math.random()*9); var ran2=Math.ceil(Math.random()*9); num1_txt.text=ran1; num2_txt.text=ran2; var answer = ran1 + ran2; answer_txt.text = ran1 + ran2; }; check_btn.onRelease = function () { if (answer_txt.text == userAnswer_txt.text){ trace ("correct"); } else{ trace ("incorrect"); } };
  Reply With Quote