Search code examples
flashactionscriptadobeflash-cs5

input in creating a simple calculator in flash as2


I'm trying to create a simple calculator in Flash using AS2.0. But my input boxes are not accepting numbers,only letter. and my result box (result_txt.text) is displaying a letter "a" whenever I click my operation buttons. Here's the only codes I used:

on(release)
{
num1_txt.text = input1_txt.text;
num2_txt.text = input2_txt.text;

var firstNumber = num1_txt.text;
var secondNumber = num2_txt.text;

oper_txt.text = "+";
var resultNumber = 0;
resultNumber = Number(firstNumber) + Number (secondNumber);
result_txt.text = Number(resultNumber);
}

I just change the operation symbol for the other operation buttons.


Solution

  • You just need to embed your fonts as I have you can see int the picture . just make sure you have checked all checkbox in the embed window

    enter image description here