Solved

Add Timer to Quiz Template

Posted on 2004-08-17
4
643 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
4 Comments
 
LVL 39

Accepted Solution

by:
blue-genie earned 125 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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 …
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
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…

929 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now