Before you begin developing in earnest with variables and advanced actions I recommend you take a few minutes to set up a debugging environment. Doing so can potentially save you many hours of frustration wondering why your carefully-crafted interactions are not working as expected.
Unfortunately, the process for setting up debugging varies slightly between Captivate versions. In Cp5 and Cp5.5 I use Rollover Captions because they can be timed to display for Rest of Project. However, there is an unfortunate bug in Cp6 and Cp7 that prevents variables inserted in Rollover Captions or Rollover Smart Shapes from being updated at run-time. So for those versions we need to resort to using Smart Shape buttons and Conditional Actions to toggle the visibility of the variables caption. I explain both workflows in full below.
By the way, this article is an excerpt from my: Infosemantics Guide to Adobe Captivate Advanced Actions e-book. It has more than 200 pages of essential information for Captivate developers.
How to set up a DEBUG slide in Cp5 or 5.5
- Insert a new slide near the beginning of your project file or project template. I usually make mine either the second or third slide in the project. Don’t set it as the very first slide because it will need to be hidden before your final publishing runs and having a hidden slide at the beginning of a project can sometimes cause issues at runtime.
- I use a slide title in all upper case as well as special graphics and captions to clearly indicate that this slide is a debugging slide and not some normal part of the content.
- Create one user variable called DEBUG_MODE_ON, set to 0 by default, and another called DEBUG_MODE_INDICATOR_TEXT which contains whatever text you want to have showing at the top of your slides when debug mode is active.
- Insert a rollover caption object on the debug slide and ensure it is situated on the very top layer in the slide object hierarchy. To make sure it’s at the top, select the object and click Bring Selected Objects to the Front in the Main Options toolbar. Also note that this object must be timed to Display for Rest of Project.
- Add some explanatory text to the rollover caption to explain that the data displayed below is displaying variable values at run-time.
- Enlarge the rollover object to cover almost all of the slide area, but leave about 10-20 pixels uncovered at the very top of the slide for the object’s Rollover Area. If you happen to be using a TOC in Overlay Mode, leave some room at the top corner (as shown below) so that the rollover area doesn’t impede clicking the TOC expand icons.
- Place another transparent text caption somewhere on the debug slide and insert the DEBUG_MODE_INDICATOR_TEXT variable to display in this caption. Make sure the text color and location of the caption will make it very prominent and easy to see on any slide in the project at runtime. This caption is also set to Display for Rest of Project.
How DEBUG MODE works in Cp 5/5.5
So how does all of this help you to debug a project? Well, if at any time your advanced actions and variables do not appear to be working as expected, just unhide the DEBUG slide, preview your project and move your mouse cursor up to hit the rollover area at the very top of the slide to trigger the rollover caption to display.
The caption into which you inserted the DEBUG_MODE_INDICATOR_TEXT variable will act as a tell-tale indicator to remind you that before you do your final publish you should really go back and hide that DEBUG slide to turn off DEBUG MODE.
How to set up a DEBUG slide in Cp6 or Cp7
In Cp6 and Cp7 rollover captions or rollover shapes don’t allow inserted variables to update. So we need to use a Smart Shape button timed to display for Rest of Project and a Conditional Action to toggle the visibility of the shape containing the inserted variables.
- Insert a new slide near the beginning of your project file or project template, but not as the very first slide. Use graphics and captions to clearly indicate this slide is a debugging slide.
- Create one user variable called DEBUG_MODE_ON, set to 0 by default, and another called DEBUG_MODE_INDICATOR_TEXT which contains whatever text you want to have showing as the label of the toggle button used to Show or Hide your debug variables. I set mine with a default value of DEBUG IS OFF.
- Insert a Smart Shape and select the option in Properties tab to Use as button. Set the button timing to display for Rest of Project. You’ll need to make this button reasonably small and place it in an area at the top or bottom of the slide so that it will not end up in the way of other controls when testing the content at run-time but will still be easily clicked.
- Double-click this Smart Shape to add text and insert the DEBUG_MODE_INDICATOR_TEXT variable to be displayed as the button label. The value of this variable will be changed when the debug display is being toggled on and off.
- Insert a second Smart Shape and resize it to cover most of the slide but place it so that it does not cover your toggle button shape. This object displays any user variables you want to view at run-time. So add some explanatory text at the top to make it obvious.
- Both Smart Shapes should be situated at the very top of the layers on the DEBUG slide, and both should be set to display for Rest of Project. Only one is set to Use as Button. To make these objects easier to find, give them meaningful Item Names (as shown below).
- Now we need to create the conditional action that will toggle the visibility of the Smart Shape displaying your user variables. That conditional action looks like this:
How DEBUG MODE works in Cp6 and Cp7
With this setup in Cp6 or Cp7, if you encounter issues with advanced actions or variables, just unhide the DEBUG slide, preview your project, and click the Smart Shape button to toggle the visibility of the other Smart Shape that displays the variables. The label text in the button will change from DEBUG IS OFF when the variables are hidden, to DEBUG IS ON when they are visible.
Just hide your DEBUG slide again to turn off DEBUG MODE and immediately disable your debugging environment. That’s all there is to it!
Can’t fit all your variables in one rollover object? Use two, or three!
One caption is usually sufficient to display all variables you need to monitor. However, you can add more captions to the debug slide if needed. Just place the rollover areas or toggle buttons side by side at the top of the slide so that you can call up each relevant caption or shape.
Add debugging to your project templates!
Since I started using this approach I’ve found it so useful when creating complex interactivity in Captivate that I now have this debugging environment built into any project templates I set up when working with clients for whom I create courseware.