|
If you want to create an engaging and interesting eLearning project, look no further than advanced actions in Captivate. With advanced actions, you can create both complex and simple event-based interactions based on one or multiple conditions.
You can use advanced actions with
The scripting for the advanced actions model in Adobe Captivate is based on the Object-Event-Action model.
Events on an interactive object, such as mouse-clicks, trigger actions that are defined for that event. You can handle complex interaction scenarios by scripting your own actions and applying them to the various interactive objects. The scripting editor in Adobe Captivate helps you script custom actions for interactive objects.
Advanced actions in Captivate can be categorized into two main actions:
- Standard actions
- Conditional actions
Note:
In Captivate 9 and previous versions, you could choose the type of action (Standard or Conditional) from the Action Type drop-down list.


Use a single script to run multiple actions in a sequence. Although the user interface provides a way to run multiple actions, it is restricted to the actions available in Adobe Captivate.
A standard action is a sequence of events that triggers one or more events. The difference between a standard action and a single action is that in a single action, you can only execute one action executed by an event.
-
Advanced Action components
Label Description 1 Name of the action. 2 Enable this check-box to make the action conditional.
3 Action items. 4 Choose an existing action.
5 Preview the structure of the action.
6 Create an action.
7 Import a shared action.
8 Export a shared action. 9 Delete an action. 10 Duplicate an action.
11 Add an action item. 12 Delete an action item.
13 Copy an action item.
14 Cut
15 Paste 16 Insert 17 Move up.
18 Move down.
19 Decision group. 20 Add a decision.
21 Remove a decision. 22 Duplicate a decision. -
a. Insert an image of a rocket and assign an identifier, for example, rocket.
b. Insert an image of a rocket with fuel propulsion and assign an identifier, for example, rocket_fuel.
c. Make the object rocket_fuel invisible.
d. Insert a smart shape and convert it to a button. On button click event, assign an advanced action.
e. On the Advanced Actions dialog, hide the object rocket, show the object rocket_fuel, and apply effects to rocket_fuel, so that the rocket appears to fly upwards. See the demo below to understand the workflow.
In this example, when you click a button, your default mail client opens with the To, Subject, and the email body pre-populated.
On button click success, create an Advanced Action and choose the Send Mail option in the Actions panel. Enter the email parameter, example@example.com?subject=Example%20subject%20line&body=Sample%20mail%20body, as shown below:

Save the action and preview the project. When you click the button, your default mail client opens and is populated in the fields provided as specified in the email parameter.

In this example, when you click a button, an Advanced Action containing a piece of JavaScript code executes producing the desired result.
For more information, see Common JavaScript interface of Captivate.
Launch the Advanced Actions panel and assign Execute JavaScript as action and write the following snippet to get the current frame of the movie:
alert(window.cpAPIInterface.getCurrentFrame());


A conditional action in the Advanced Actions panel depends on whether a statement executes if a certain condition is met. For example,
if (totalMarks<=80) { print(“Take the test again”)’ } else { print(“Congratulations!You have passed”); }
In your eLearning projects, you can add greater interactivity depending on certain pre-defined conditions.
-
Advanced Action components
Label Description 1 If block. Check the conditions in this block. For example, if a is equal to b.
2 Action block. The actions to execute if the above condition or conditions return true.
3 Else block. The actions to execute if the above condition or conditions return false. 4 Decision blocks. You can combine a conditional action with a standard action. Place the standard action in a second decision block.
5 Add a decision. 6 Remove a decision. 7 Duplicate a decision. 8 Select to choose action type for if.

For example, use the while statement to check the validity of a user name and password. Open the Advanced Actions dialog and choose While from the Perform actions drop-down list. Assign the following:

Save the action and preview the project. You stay on the login page until you enter the correct user name-password pair.
Before moving on to examples, let us look at the concept and application of variables in conditional statements. A variable is a value that can change, depending on conditions or on information passed to the program or application. In Captivate, variables store values and you can usually change those values using advanced actions.
For example, when a=5, a stores 5 in a memory location. a retains its value until a piece of code changes the value to something else.
In Captivate, there are two types of variables:
System variables: System variables come pre-defined with Captivate. You cannot create or modify a system variable. These variables enable you to modify what your e-learning module, is doing at runtime. For example, if you assign a number to the variable cpCmndGotoSlide, at runtime, you would be taken to the slide as specified by you.
User variables: These are variables that you, the author, can create and name as you choose. User variables are project-specific.
In this example, when you click a button, an object disappears and reappears when you click the button again. Perform the following steps:
In this example, if you enter the correct
When editing a script, use the appropriate icons to add, remove, copy, cut, paste, insert, or move a statement (a line of code).
Use the drop-down list to change the type from Variable to Literal, or the other way round.
To remove a decision, select the decision and then click the delete icon.
- To add a decision tab, click +.
- To delete a decision tab, click the tab, and then click '-'.
- To duplicate a decision tab, click the Duplicate Decision tab.
- To reorder the decision tabs, use the Move Left and Move Right icons.
- To duplicate the entire conditional action (all decision tabs), click the Duplicate Action icon at the upper-right corner of the Advanced Actions dialog box.
- To preview the conditional action, click the Preview icon at the upper-right corner of the Advanced Actions dialog box.
You can copy an Advanced Action into another project by copying the objects or slides associated with the Advanced Action and pasting them in the target project.
In a project, Advanced Actions can be called from various objects or triggered by many events. The following table summarizes the different scenarios and indicates whether the associated Advanced Actions can be copied:
Advanced Actions associated with... | Can be copied? |
Objects | Yes |
Slides/Question slides | Yes |
Question pools | No |
Project Preferences (Quiz Pass/Fail) | No |
While copying a slide or an object associated with an advanced action, ensure that you copy all objects or slides that are referenced within the Advanced Action. For example, consider that an Advanced Action "MyAction" is associated with a button. The action contains a 'Show' action that displays an image 'Flower', and a 'Hide' action that hides an image 'Mango'. Now, if you need 'MyAction' in another project, copy the slide containing the button, and the slides containing the images 'Flower' and 'Mango'. Then, paste them into the project.
If Advanced Action includes this action... | ...then... |
Play Audio | The audio file is copied into the target project |
Variables | The variables are copied into the target project. If a variable configured in the Advanced Action does not exist in the target project, the variable is automatically created. If a variable exists with the same name, a new variable with the same name suffixed with a number is created. |
Jump to Slide | The Advanced Action is successfully copied only if the target slide is already copied into the target project. |