|Page (4) of 4 - 10/26/04||email article||print page|
DVD Studio Pro Scripting, Part 4Pausing and resuming a timer Resuming the timer and continuing the quiz
But obviously it can't end there. We need a way for the user to get back into the quiz and resume the timer. To do this, we have a button in both the "Incorrect 1" and "Correct 1" splash screens to move on to the next question.
All we're going to do now is connect these buttons to the scripts we created in the previous tutorials, called "Correct" and "Incorrect." Connect the "Correct" script to the button on the "Correct 1" menu; and connect the "Incorrect" script to the button on the "Incorrect 1" menu. (You can connect the scripts now or after your modify them. The results will be the same.)
Previously we had these scripts connected to the individual answer buttons. But because of the way we structured these scripts, they can be placed anywhere in our presentation without modification. The user will always be taken to the next question based on the value of GPRM 4. (That was pretty forward-thinking of us, eh?) So for the purpose at hand the only modification we do need to make is to add a command to resume the timer when the user clicks the "Next Question" button.
So open up the "Correct" script, and add a new command by clicking the "+" icon in the Script tab.
Select the new command, and look at the Script Inspector palette. Switch the "Nop" command" to "GPRM Mode." And set the mode once again to "Counter" (setting it to GPRM 2, of course).
The effect of this is that the timer will resume from it current position, rather than starting back from 0. That's all there is to this.
Finally, move this command up above the commands that jump to individual questions. We want the timer to resume before jumping tot he next question, or that command will be ignored entirely. (All commands after a valid Jump command are ignored, so if you leave this new command at the end, the script will jump the user to the next question, but the timer will not resume.)
That's it for now. You can download this project (for DVD Studio Pro 3) to examine it for yourself and compare it against your progress. It contains all of the completed scripts, which you can feel free to use and modify, as well as the menus and graphics for the quiz. Simulate it to see how it works, and then look over the individual elements to see how they can be modified to suit your needs.
Click to download: ScriptQuiz3.zip (116 KB)
If you have any further questions, please feel free to drop me a line in the DVD Studio Pro user forum here.
Related Keywords:apple dvd studio pro, dvdsp, scripting, timer, countdown, interactive quiz
To Comment on This Article, Click HERE
Most Recent Reader Comments:
Click Here To Read All Posts
Must be Registered to Respond (Free Registration!!!, CLICK HERE)
Source:Digital Media Online. All Rights Reserved