I’m making a calculator using Flash MX that works the same way as the basic calculator found on windows (not the scientific one). But having the user input a number, store it as a variable, store which function the user wants to perform and clear the text field then store the new input in the same text field as a different variable and multiply or add or divide or subtract the 2 numbers and getting the equals sign to display the answer when clicked is harder than I thought it would be. I’d appreciate any help I can get. Thanks.
Make a global variable for what function is being performed and the overall answer, so you can avoid doing the calculations in the textbox.
Let them input what they want, then when they press a function button, store the value of the textbox in the answerVar, and the function type in the functionVar.
[URL=“http://www.actionscripts.org/showMovie.php?id=1225”]
Clear your textbox, then more input and a function press. If it’s anything other than equals, Do “answerVar = answerVar functionVar textboxText”. If it is equals, output answerVar to the textbox.