ForumsProgramming ForumMaths Game

10 6828
BehemothBoy
offline
BehemothBoy
33 posts
Nomad

Hey guys,

I'm trying to make a maths game where two numbers are randomly generated and you have to add them together and type the answer into a input field. The thing is that it always says the answer is wrong.

Here is the code:

//Write random numbers in the text boxes
TextBox_txt.text = random(100);
TextBox1_txt.text = random(100);

//Sets the yes and no MC's visibility to false
Yes_mc._visible = false;
No_mc._visible = false;

//Check to see if the answer is right or wrong
Go_mc.onRelease = function() {
if (Answer_txt.text == TextBox_txt + TextBox1_txt) {
Yes_mc._visible = true;
}else{
No_mc._visible = true;
}
}

I would just like to know what it isn't working, thanks.

  • 10 Replies
Showing 16-15 of 10