EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Page 200

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
200 Syntax and Language Fundamentals
3. Select Control > Test Movie.
The Output panel displays the following text:
You got 11 out of 13 answers correct, for a score of 84.62%.
When you call Math.round() in this example, the score rounds to the nearest integer (85)
and is displayed in the Output panel. If you multiply the number by an additional 100,
before you call
Math.round(), and then divide by 100, you can make Flash round the
number to 2 decimal places. This results in a more accurate score.
4. Try changing the correctAnswers variable to 3 and select Control > Test Movie to test
the SWF file again.
If you are building a testing application, you might want to create a series of true/false or
multiple choice questions using the RadioButton and Label components. After users finish
answering each of the questions and click the submit button, you can compare their answers
to an answer key and then calculate their score.

Table of Contents

Related product manuals