|Page (2) 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
But we also need to create a Compare Command. If we don't, the Next button on our final menu will add 32, but have nowhere to go because there won't be any more menus left. So we want to set the Compare Command to execute if GPRM 0 is less than (<) an Immediate Value of a certain number. And that number is your total number of menus multiplied by 32. So, if you have 30 menus, this value should be 960 (30x32=960), as in the example below.
3. Then we need to add one more command, a simple Jump that takes us back to the first menu in the slideshow presentation--the one that has the prescript attached to it. So add one more command to the script, and make it Jump to Menu 1 (or whatever your first menu is called). This jump will only occur if the Jump Indirect command doesn't have someplace to jump to--in other words, when it reaches the last menu in the slideshow.
And that's it for the Next script. You can attach it to your Next button, then duplicate it across all of your menus, including the first.
The 'Previous' script
Finally we arrive at the Previous script. This one is similar to the Next script, with a couple of major exceptions, and I'll bet you can guess what those are. But I'll lay it out for you anyway. This script will use three commands.
1. The first is a Set GPRM command. Instead of using Add this time as the operation, we'll use Sub, and we'll set the value to 32. This way when this script is invoked, it will subtract 32 from the value in GPRM 0, which is the value for the menu preceding the one the viewer is currently watching.
2. The second command is another Jump Indirect, just as before. But this time, the Compare Command will be a little bit different. We'll make it execute only if GPRM 0 is greater than (>) the numerical equivalent of the first menu in the slideshow. (If that's Menu 1 in your project, the value is 32.)
3. And, finally, just as before, we want to create an alternate jump target in case the value of GPRM 0 is not greater than 32--in other words, if the viewer is on Menu 1. The jump target will depend on what you want to do. If you want the Previous button on Menu 1 to take the viewer backwards to the last menu in the slideshow presentation, set that as the jump target.
And here's the final command and script.
Now just connect that to your Previous button and duplicate the button across the menus in your presentation, and you're done.
If you'd like to download my sample scripts for use in your project, you can do so here:
Download: Nagelscripts2.zip (4 KB)
Looking for more articles about DVD Studio Pro? Check these.
DVD Studio Pro Scripting, Series 1
- Part 1: General scripting information
- Part 2: Creating an interactive quiz
- Part 3: Keeping track of time
- Part 4: Pausing and resuming a timer
- Scripting a dynamic 'play all' button
- Scripting System Streams
- Scripting previous/next buttons for menu navigation
- DVDSP General Walkthrough
- Customizing Button States
- Highlights and Overlays
- Zoom Masks
- Customizing Masks
- Fixing color shift (for DVDSP 2.0)
- Motion Masks (custom patches)
- Remote Rollovers
- Setting Up DTS Playback on the Mac
- Creating Alpha Transitions, Part 1
- Quick Tip on Stories
- Alpha Transitions, Part 2
- Delaying Button Highlights
- Buttons over Video
- Media Storage
- Creating a "Play All" Button by Merging Tracks
- Display Conditions and Prescripts
- Bitrates in DVD Studio Pro
Related Keywords:apple dvd studio pro, scripting dvds, next button, previous button
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