Feb 24, 2012

Variables & Advanced Actions in Captivate - 2

To begin with learning about Advanced Actions, let us try a simple exercise. cpInfoCurrentSlide is a system variable in Captivate which returns the value of the current slide number. We will now try to create a user variable to do the same thing.
-          Create a new variable named SlideNo.
o   Click on Add New
o   Type in the variable name as SlideNo
o   Give default value as 0 (zero)
o   Type in any description (this helps when you have a lot of user variables in a project)
o   Click on Save.
Playing with variables is more or less a logical process. Right now, we have this variable called SlideNo whose value is 0. Our objective is to display this variable in every slide so that it returns the value of the slide number. Theoretically, the value of this variable should be incremented by 1, as it enters a new slide i.e., you add 1 to its value when it enters the first slide, add another 1 when it enters the second slide and so on. Let us see how to do this.
-          Go to Advanced actions, and select Create a new action from the menu.
-          Type in the New Action Name as SlideNumber
-          Double - Click on Add Statement
-          Double – Click on Statement (displayed in red)
-          Choose Assignment
-          A menu will be shown displaying all the variables in the project (including System Variables).
-          Choose the variable SlideNo we created in the above step
-          In the next field, two options will be shown, Variable and Value
-          Choose Variable, and then select the same user variable SlideNo
-          Double Click on the operator icon and select ‘Plus’ symbol
-          Next time choose Value from the options shown.
-          Type in 1 and click on Save.
Now we have successfully created an advanced action which increments the value of the variable by a value of 1. The next step is to execute this action, every time it reaches a new slide. To do this, we double click on the thumbnail image of the slide to display the slide properties. From the menu for On Slide Enter, select Execute Advanced Option. Select, Slide Number in the Action menu.
Unfortunately, the Apply to All slides option is not working for this option. So you have to assign this action for every slide one by one. Use the syntax mentioned in this article to display the variable in your slide.
Note: This is not a good method to display slide number, because if you have branched your slides, or if you go back to a previous slide, the count will go wrong. Anyhow, the purpose of this example is only to show you the use of Advanced Actions and Variables.

Think of any other cases where you can use Variables and Advanced Actions and try to create your own actions. Make a few mistakes and you will learn the trick soon.