Tutorial: Page (2) of 2 - 04/15/05 Email this story to a friend. email article Print this page (Article printing at MyDmn.com).print page facebook

Scripting Next and Previous Buttons in DVD Studio Pro 3

Creating dynamic jump buttons for navigating menus
2. Now we want to do something with this value. We're going to use it to jump to whatever element in our DVD has this final number as its value. To do this, we add a Jump Indirect command, and, of course, set it to GPRM 0.

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
DVD Studio Pro Scripting, Series 2
Other scripting articles
General design and authoring topics
If you have any further questions or requests for tutorials, please be sure to visit me in the Apple DVD Studio Pro forum by clicking here.

Page: Prev Page 1 2

Related Keywords:apple dvd studio pro, scripting dvds, next button, previous button

To Comment on This Article, Click HERE

Most Recent Reader Comments:
  • This is poor solution - here's why... by anselan at Oct. 27, 2006 1:27 pm gmt (Rec'd 3)
  • Scripting Next and Previous Buttons in DVD Studio Pro 3 by DMN Editorial at Apr. 15, 2005 5:03 pm gmt (Rec'd 3)

    Click Here To Read All Posts
    Must be Registered to Respond (Free Registration!!!, CLICK HERE)
  • [ServletException in:/common/ads/links.jsp] The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application'

    Our Privacy Policy --- @ Copyright, 2015 Digital Media Online, All Rights Reserved