Solved

Add Timer to Quiz Template

Posted on 2004-08-17
4
642 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
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): …
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

708 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

19 Experts available now in Live!

Get 1:1 Help Now