I was recently asked by a fellow Captivate developer if it was possible to show the date on a Captivate slide. My answer was a quick yes... use the cpInfoCurrentDateString variable within a text caption. When previewed, the date on the learner's computer will appear within the caption.
The developer needed a bit more. He needed the appearance of the date to be in a specific format. For instance, he needed the date formatted as December 18, 2013. The cpInfoCurrentDate variable displays the date as 12/18/2013.
I looked through the available Captivate variables and came across the following default variables.
Variable |
What it Displays |
Displays as |
cpInfoCurrentDate |
The day of the month |
18 (1 through 31) |
cpInfoCurrentMonth |
The current month |
12 (01 through 12) |
cpInfoCurrentYear |
The current year |
2013 |
cpInfoCurrentDay |
The day of the week |
4 (Sunday being 1 through Saturday being 7) |
Sadly, none of the default variables were going to work in this instance. Stumped only for a moment, I came up with a simple advanced action to solve the problem.
First, I created a user variable (Project > Variables) called myMonth with the following Value and Description:
Next, I created a Conditional action (Project > Advanced Actions) and named it InterpretMonth.
To make the action easier to work with, I created 12 Decision Blocks, and then gave each one the name of a month (January, February, etc).
Then I set up the InterpretMonth action as shown below within each Decision Block (January is shown below). It may feel like a lot of work, but once you start, it is a simple matter of repetition.
Note: In the two images above, notice that I have increased the value to match the Decision Block's month. For instance, February shows CpInfoCurrentMonth is equal to 2. My December Decision Block would read CpInfoCurrentMonth is equal to 12.
Once I was done with the Advanced Action, I returned to my slide and inserted a text caption. I typed the text and inserted the variables as shown below:
The last thing I needed to do was invoke the InterpretMonth action. An easy time to do this is as you transition to slide 2. Why not slide 1? Because invoking an advanced action as you enter slide 1 is not reliable. Your best bet is to do it on slide 2 or later.
Preview the project. When you get to the slide containing the variables, you should see the date formatted as the current month, day and year.
Looking to learn Captivate quickly? IconLogic offers multiple live, online Captivate 6 classes each month including An Introduction to Adobe Captivate and Advanced Adobe Captivate concepts.
Comments