?
Solved

Add Timer to Quiz Template

Posted on 2004-08-17
4
Medium Priority
?
674 Views
Last Modified: 2008-03-17
I am using the Quiz template supplied with Flash MX. I would like to add a timer that starts on the first question and stops on the results page and writes the total time taken on the quiz to the screen. I am also randomizing the questions. Please help.
0
Comment
Question by:LOBO
1 Comment
 
LVL 39

Accepted Solution

by:
blue-genie earned 500 total points
ID: 11828878
hi i'm not sure how the quiz template works, (never used it before) - but to create a timer you just need to use the setInterval to count seconds, like so:

function callback() {
      valuer = valuer+1;
      trace(valuer);
      //set textfield to whatever
      if ((valuer>20) || (valuer == 0)) {
            clearInterval(id);
      }
}
valuer = 0;
id = setInterval(callback, 1000);

then, at the last question, set another variable to equal what valuer is...... show that in the textfield, and reset valuer to 0.

and that should do it.

blu.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
Suggested Courses
Course of the Month15 days, 12 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question