This article is not meant for power users but as an introduction to the use of Advanced actions for controlling system variables and user variables. I suppose that you have read and 'absorbed' the terminology and techniques for variables described in this first article:Use Power of Variables without Advanced actions. The article you are reading for the moment is also a basic introduction to advanced actions, both standard and conditional.
I would like to explain how you can extend the possibilities of working with variables, using Advanced actions, using practical examples. Screenshots will be taken in Captivate 5, but most of the examples can be worked out in Captivate 4 too. If there is a difference or limitation, I will explain.
You already worked with actions in Captivate. Some examples:
In this examples you see that the action is triggered by an 'event'. Events here are: Entering/Exiting a slide, Clicking a button. By default you are limited to one unique action to be performed when an event occurs. Since the number of events are somehow limited, it happens that you want to have multiple actions to be executed by this event. An example: on Entering a slide you want to Increment (another action) a counter AND to Show (=action) a formerly hidden Text Caption. CP4-users will now be happy, because they can assign Multiple Actions to an event, but... I experienced some issues with that feature. Multiple actions will not always work as they should. So even for CP4-users I would strongly recommend the workflow always to be used by CP5-users:
Use an Advanced (Standard) Action when you need an event to trigger multiple actions!
An Advanced (Standard) Action is really a sequence of actions. You will recognise most of those actions because they can also be assigned as unique actions to an event. However some actions will seem to be missing because they are replaced by more powerful ones, which you will not recognise at once.
Some more complicated actions cannot be realized with the actions available in the lists you can assign as a unique action to an event. A practical example: you want to create a toggle-button to show/hide the playbar. This means that when you click the button, and the playbar is visible (cpCmndShowPlaybar=1), you want this system variable to be changed to the value=0. If the playbar is invisible (cpCmndShowPlaybar=0), you want it to be changed to 1. This can only be done using this 'formula': cpCmndShowPlaybar = 1 - cpCmndShowPlaybar
Solution is to create an Advanced action too, that will (perhaps) have only one statement. This kind of formula in Captivate 5 is called an Expression, In version 4 it will be achieved using Assign. But using the Assign action for this kind of formula is only possible in an Advanced action. That is why I prefer the new 'Expression' because it is less confusing.
Use an Advanced (Standard) Action when you need an event to change the content of a variable with an Expression!
If you want to check a condition and to execute a different bunch of actions depending on the result of that condition, you need to create an Advanced (Conditional) Action. In paragraph 6 I a basic Conditional action is constructed. I have published several articles about usecases for that kind of actions.
Use an Advanced (Conditional) Action when you need an event to trigger different sequences of multiple actions, based on one or more conditions!
It is also possible to combine standard and conditional actions. The workflow is explained in another article Standard and Conditional in one Advanced action.
Please watch this movie: it has 4 slides
Content on this page requires a newer version of Adobe Flash Player.![]()
The system variables and user variables used in this example are:
| Variable | Type | What? |
| cpInfoCurrentDateString | system | shows date in US-way: 10/4/2010 |
| cpInfoCurrentYear | system | current year: 2010 |
| cpInfoCurrentMonth | system | current month: 10 |
| cpInfoCurrentDate | system | current day: 5 |
| cpInfoTimeElapsedMS | system | time since opening SWF, in milliseconds |
| v_choice | user | will store last choice: US, Europe or World |
| v_clicks | user | will count number of clicks |
| v_TimeSec | user | calculated time since opening project in seconds |
The first slide DateChoice has several Advanced Actions, triggered by different events:
| Advanced Action | Type | Event |
| Init | Standard | On Enter (Slide) |
| US | Standard | Click on button 'US' |
| Europe | Standard | Click on button 'Europe' |
| ISO | Standard | Click on button 'ISO' |
| JumpChoice | Conditional | On Exit (Slide) |
This action is triggered when entering the first slide, DateChoice.
The first has those Text Captions and buttons, from top to bottom:
This advanced action Init only uses Hide statements as you see in this screenshot:

Tip:If you prefer to reset the counter for the number of clicks when the user re-enters this first slide, you can add the statement Assign v_clicks with 0
Those actions are triggered by the corresponding buttons Btn_US, Btn_EU, Btn_ISO.
The three actions are very similar, use the duplicate functionality of the Advanced actions dialog box and edit the duplicates. I explain the sequence of statements for the action US:
Expression v_clicks = v_clicks + 1
Assign v_clicks with v_clicks + 1

This action is triggered when exiting the first slide, DateChoice.
Since we have 3 possibilities for the jump action, we need 3 decisions to evaluate the content of the user variable v_choice. In the screenshot they are labeled World, Europe and US:
I do not use the 'Else' region, so I did not show this region of the dialog box.
If you want a more detailed intro to conditional actions, here is a video tutorial: Create Customized Feedback

If you tried to replicate the usecase, to finish it you will have to add a Click box on each of the slides US_Slide, Europe_Slide, World_Slide and make this Click box cover up the slide. The action 'On Success' for this Click box is always the same: 'Jump to slide DateChoice' (= first slide).
Hope that the usecase I explained gives you some ideas about using variables in combination with actions. Here are two other ideas that you could work out:

This work is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License