Use CTRL+Enter to do another test run. The unwanted text should have
gone away but the push button will still not work.
Create the event handler to process the button release.
Click the Add Button to make sure it is selected (and nothing else
is selected).
Click the Actions-Movie Clip to open this view.
Make sure you are in Expert Mode
Enter this code.
on (release)
{
_root.outputText = _root.inputOne + _root.inputTwo;
}
Do a test run with CTRL+Enter. The program
should work but it might not do what you expect.
This is the problem. The input and output controls are designed to work
with text. The (+) operator is used to join text as well as add numbers.
In this case, it joins the text so 23 + 45 becomes 2345!
To fix this problem, your code must convert the text to a numeric format.
One way to do this is to use (- -) instead of (+). The (-) operator is
only used on numbers so the program has to change the text into a number
before it can process the instruction. Mathematically, using two (-) operators
is the same as using one (+) operator. It is important to put a space
between each (- -) sign because (--) means "subtract one" and
you don't want to do this here. This is the correct code.
on (release)
{
_root.outputText = _root.inputOne - - _root.inputTwo;
}