- Now available : Mac OS Catalina compatible Adobe Captivate update for 2019 release users . Get update now!
- Asset Panel not loading in Adobe Captivate (2019 release)? Read More to find a solution.
|
If you want to create an engaging and interesting eLearning project, look no further than advanced actions in Captivate Classic. 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 system and custom variables, text entry boxes, mathematical expressions, quizzing, and widgets.
The scripting for the advanced actions model in Adobe Captivate Classic 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 Classic helps you script custom actions for interactive objects.
Advanced actions in Captivate Classic can be categorized into two main actions:
In Captivate Classic 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 Classic.
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.
From the main toolbar, click Project > Advanced Actions or hit Shift+F9.
In the Advanced Actions dialog, the following labels describe the items on the dialog.
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. |
Assign a name to the action and create action items. As an example, create a standard action that mimics the launch of a rocket. When you click a button, the rocket takes off.
On an empty slide, perform the following:
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 Classic.
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());
When you preview the project and on clicking the button, you get the following pop-up:
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.
From the main toolbar, click Project > Advanced Actions, or hit Shift+F9.
Select the Conditional Tab check-box. When you enable the option, you can see the if-else condition blocks and the actions area. Choose any of the conditional expressions with the if statement, as shown below:
In the Advanced Actions dialog, the following labels describe the items on the dialog.
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 Classic, 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 Classic, there are two types of variables:
System variables: System variables come pre-defined with Captivate Classic. 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.
Click Project > Variables.
To create a variable, on the Variables dialog box, click Add New. Type the name of the variable and assign it a value.
Use the variable in your project. For example, displaying the value at runtime. Insert a text component in a slide and add some text.
Insert the variable and concatenate to the text above. Click Insert Variable [X] in the Property Inspector panel and choose the variable.
The slide now looks, as shown below:
The variable is enclosed by two $ signs which are special identifiers for variables.
Preview the project. At runtime, you can see that the value of the variable gets displayed.
To use the variable in an Advanced Action, for example, insert a button in the slide, and assign it to execute an Advanced Action on a click event.
Launch Advanced Actions and provide the following information in the if-else block.
In this Advanced Action, when you click the button and if the value of the variable is “Hello World”, then a new browser window launches the google.com search page.
To modify a variable, open the Variables dialog box and select the variable you want to change. Click Update.
You cannot edit the variable's name. Edit the Value or Description fields as needed and then click the Update button.
In this example, when you click a button, an object disappears and reappears when you click the button again. Perform the following steps:
Declare a variable myVar with value equal to 0.
Create an advanced action B1 where:
If the value of myVar is equal to 0
Then hide the object and assign the value of myVar to 1.
Else show the object and assign the value of myVar back to 0.
Save the action and preview the project. You can see that when you click the button, the object disappears and appears again when you click the button again.
In this example, if you enter the correct user name and password, you are taken to a welcome slide. If you enter an incorrect user name or password or both, you are taken to a different slide. Execute the following steps:
Declare two variables, uName and pWord with the values “test” and “password” respectively.
Create an advanced action, A1, where:
If the value of uName is equal to “test” and the value of pWord is equal to “password”
Then perform the following actions, as shown below:
Else move to a different slide, as shown below:
Save the action and preview the project.
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.
Select Project > Advanced Actions.
In the Existing Actions, select the action that you want to modify or delete.
Do one of the following:
Use the appropriate icon at the upper-right corner to delete or duplicate the action
To update the advanced action, use the appropriate menu icons to update the statements and then click Update.
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. |
Select Project > Advanced Actions.
In the Existing Actions, select the action.
Click Usage.
The slides in the project that use the selected script are displayed.
In the Property Inspector (Window > Properties), go to Action.
Select Execute Advanced Actions.
In Script, select the script that you want to run from the Action menu.
In the Property Inspector (Window > Properties), go to Action.
In the action menu, select Execute Advanced Actions. Examples of actions are On Success, On Failure, and Lose Focus.
In Script, select the script that you want to run from the Action menu.
To learn more about Captivate Classic and how you can create engaging learning content, download the following projects: