The AdditionExample Applet
Introduction
In this example, it is shown how to set up a simple applet for use in a WeBWork problem. The complete code for the applet, as well as the corresponding PG file, can be downloaded from (add download site). The applet, shown below, asks for the sum of two integers. Notice that there are no buttons for checking the answer in the applet, since this will be handled by WeBWork.
Initial Setup
The initial code for the applet can be downloaded from (add download site), or it can be created by the following steps.
- Create a new applet in Flash and draw the controls as shown in the picture above. The first two text fields are of type Dynamic Text, and the rightmost one is of type Input Text
- Name the text fields, respectively,
txtFirstNumber
,txtSecondNumber
andtxtResult
.