One of the new features added in Adobe Captivate 4 was Variables and Scripting. In this blog post we will try to understand some simple usages of Variables. In later posts we can deal will the scripting portion.
OK. Let’s start off with the simple question – What is a variable in Adobe Captivate? Well, it is a placeholder for data. This data portion generally varies but may be constant in some cases. Example of a constant variable (nice oxymoron ) is author name. While an example of a varying variable (the normal case) is slide number.
In Adobe Captivate 4, there are two types of variables:
- System Variables.
- User-Defined Variables.
System variables are pre-defined variables. Generally these are read only, e.g., time-of-day (But you can also change them using scripting). User-defined variables can be created and updated by users. For current discussion, we will only consider system variables.
Adobe Captivate 4 groups system variables into the following groups:
- MovieControl – These are variables which control playback of Adobe Captivate generated SWF movie. User can use these to pause/resume movie, go-to-next slide, go-to-previous slide, etc.
- MovieInformation – These are variables which list information about an Adobe Captivate generated SWF movie. E.g. variables for current slide number, current frame number, etc.
- SystemInformation – These are variables which are picked from the user’s computer. E.g. current date, current time, etc.
- MovieMetaData – These variables provide information about project namely, project name, author name, company name, etc.
- Quizzing – These are variables which contain quizzing related information. E.g. number of attempts, percentage of questions answered correctly, etc.
Good news is that, you don’t need to remember these. You can browse through the variables and their description using Actions Dialog. Actions dialog can be accessed through the project menu (Project->Actions…). Here’s a little SWF about Actions Dialog. It shows how to select the various variables and get a little description of each.
Variables can be used to do a multitude of things like:
- Showing dynamic text in captions.
- Accepting user input and storing it in a movie.
- Advanced branching depending upon variable values.
- Getting quiz data, etc.
This post deals only with “Showing dynamic text in captions”.
Let’s try to put variables to use. We have all seen footers in Microsoft Word and other applications. Let us try to create footers for each slide in Adobe Captivate.
Suppose the Adobe Captivate project contains 3 slides. In the published SWF, footer on the first slide should read: Slide 1 of 3, footer for second slide should read: Slide 2 of 3, and so on.
So, in order to create footers of this type we need two pieces of information:
- Current slide.
- Number of slides in the SWF.
These are provided to us by two system variables.
- Current Slide – cpInfoCurrentSlide
- Number of Slides in SWF – rdinfoSlideCount
Both these variables are in category MovieInformation. In order to use these variables, we need to create a text caption and add the variables to it. The text caption string will contain the following string: Slide $$cpInfoCurrentSlide$$ of $$rdinfoSlideCount$$. This SWF demonstrates how to do that.
Now, that we have created the footer text caption, we need to do the following:
- Move this text caption to a suitable location in slide (bottom-left or whatever is “suitable” for you).
- Change the duration of text caption to “rest of project” using the following steps:
- Right Click on Text Caption.
- Context menu opens up.
- Select Properties… menu item.
- In text caption properties dialog select “Options” tab.
- Go to “Display for” in “Timing” group box.
- Change the combo box item from “specific time” to “rest of project”.
That’s it. Were done!!! Publish the Adobe Captivate project to a SWF and see the footer in action. Here’s an example SWF.
Here’s the Adobe Captivate project for the above SWF.
That’s all for this post. Your comments are most welcome. Next time, we will try to add a little “action twist” to this footer!!! Till then, Adios.