
Run and test the application 199
This code sample purposely contains a logic error, which will help demonstrate how
debugging works.
Run and test the application
Once you’ve entered the sample code, you can run and test the application.
1. Save the file and then click the Run command ( ) on the main toolbar. The application
opens in a web browser.
2. To test the application, enter 100 as the amount, select US Dollars from the combo box
control and then click the Calculate button.
You should see the conversion amount displayed in euros.
3. Now, to demonstrate the flaw in the code, enter 100 as the amount, select Euro from the
combo box, and then click the Calculate button.
You should see the following:
Rather than displaying a conversion value in US dollars, the
NaN data type constant is
displayed, indicating that the function has somehow failed.
To help locate the flaw in the code, you use the debugging tools in Flex Builder.
Comentários a estes Manuais