|Page (2) of 4 - 10/26/04||email article||print page|
DVD Studio Pro Scripting, Part 4Pausing and resuming a timer The new scripts: pausing the timer
So now we're going to add two new scripts to our project, one called "Pause Correct" and one called "Pause Incorrect." There are many reasons you'd want to pause the timer in a timed quiz. In this case, we're pausing to show whether an answer was correct or incorrect, and possibly providing the user with an explanation of the result. These things take time, and we don't want this time taken away from the total time allotted to the quiz. So these two scripts will stop the timer and direct the user to a result page (one of two for correct and incorrect answers). Here's how it's done. (We'll get to how to resume the timer from where it left off in the next section.)
Begin by creating a new script called "Pause Correct" (Project > Add to Project > Script). The purpose of this script is to pause the timer when the user answers a question correctly and jump to another menu stating that the correct answer has been given.
In your new script, add a command. In the Script Inspector palette, select "GPRM Mode." You'll recall that this is the command we used to start the timer in our previous tutorial. This time though we'll use it to set GPRM 2 to "Register." The effect of this is that the counter stops, but the value of GPRM 2, rather than going back to 0, remains at the value when the time stopped. It's that simple.
Then we just add a jump command to our script to go to our new splash screen, which states that the question was answered correctly. In my case, that means that I set the jump to the menu I've called "Correct 1."
That's it for the first script.
Related Keywords:apple dvd studio pro, dvdsp, scripting, timer, countdown, interactive quiz
Source:Digital Media Online. All Rights Reserved