Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Add Timer to Quiz Template

Posted on 2004-08-17
4
Medium Priority
?
668 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
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.

636 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