|Page (1) of 2 - 04/15/05||email article||print page|
Scripting Next and Previous Buttons in DVD Studio Pro 3Creating dynamic jump buttons for navigating menus
The concept is this: We want to create one script for our "next" buttons and one script for our "previous" buttons and let the script itself figure out where the user will jump next, rather than setting the targets for these buttons manually. To do this, we'll need to create a Next and Previous script, plus one little prescript to get things started, for a total of three scripts. (You can download my versions at the end of this tutorial, in case you get confused at any point.)
To kick things off, we're going to create a small script that will be used as a prescript for our first menu. This is simply a script to set a value into a GPRM that will be used as the base value for subsequent scripts.
By way of explanation, every menu has a numerical value that can be accessed and used as a means of getting directly to that menu with a Jump Indirect command. These values are determined in DVD Studio Pro-authored discs based on the order in which they appear in the Outline tab. The first one has a value of 32; the second 64; the third 96; the fourth 128; and so on, adding 32 for each subsequent menu. Knowing this, we need only store the value of a particular menu in a GPRM, then use that value with a Jump Indirect command to take us there.
But with the technique I'm showing you today, this will require us to insert the value of the first menu manually. Here's how it will work.
1. Choose Project > Add to Project > Script.
2. Select the script in the Outline tab, and rename it "Prescript Menu 1," just so we can keep track of it easily. Then double-click it to open it up in the Script Editor window.
3. Select the Nop command, and then switch this in the Inspector palette to a Set GPRM command. For this example, we'll be using GPRM 0, but you can use any available GPRM instead, if desired. Use the values for this script that you see below.
The effect of this script is to place a value of 32 in GPRM 0. The rest of our scripts will use this value as a base.
Because this is being used as a prescript, you might want to add a second command here--just a Nop command. Prescripts sometimes need something like this, although I haven't run into any trouble without it for this particular script.
Note: If the first menu in your slideshow presentation is not menu 1, do not use 32 as the base. Use the number of the first menu in the slideshow multiplied by 32. So, if Menu 20 is the first menu in your slideshow presentation, you would use 640 (20x32=640).
Now you're done. All you need to do is set this up as the prescript for Menu 1 (or whatever the first menu will be in your presentation. To do this, select the menu in the Outline tab. Then, in the Inspector palette, click on the Advanced tab. There you'll see a spot for setting a prescript. Set it to "Prescript Menu 1."
Make sure you attach this script only to the first menu in your slideshow presentation, otherwise none of this will work properly.
The 'Next' script
Now we can get busy with the important stuff: the scripts for creating the dynamic Next and Previous functionality. For the Next script, I'll assume you'll have a Next button on all of the menus in your slideshow, including the last one, where the Next button will take the viewer back around to the first menu in the presentation. This requires three commands in the script.
1. The first of these is another Set GPRM command. This time, instead of using the Mov operation, we'll use the Add operation. We'll set the Source Type to "Immediate," the Value to "32" and the target to GPRM 0 (or whichever GPRM you're using for this). The effect of this will be, simply, to add 32 to whatever value is currently stored in GPRM 0. In this way, as the user progresses through the slideshow, this number will continue increasing by 32 until he or she reaches the end.
Related Keywords:apple dvd studio pro, scripting dvds, next button, previous button
Source:Digital Media Online. All Rights Reserved