Open a blank project and add a content slide.
Advanced Actions allow you to execute some complex tasks and workflows in the Captivate project when an event is triggered, or when certain conditions are met.
The procedures in this document require you to use assets such as images and sample Adobe Captivate project files. You can choose to use your own assets and samples. However, it is recommended that you download and extract the following zip file to your computer:
Before explaining Advanced Actions, some basic concepts which are useful to understand Advanced Actions are covered.
Literals are fixed values. A literal can be either an alphanumeric value, or it can be a number. For example, in real life, John, Sarah, 100 are literals as they are fixed values.
And, for a string literal, like “John”, if you use it with any function in conventional programming, the value of the literal changes. If you want to reverse the literal above, use “John”.reverse().
Variables are entities whose values can change. For example, in real life, if 'color' is considered a variable, red, blue, and green are some of the values logically associated with that variable. So variables can be considered as placeholders for different values.
Variables in Captivate can be classified into system variables and user variables. Following is a brief description of them.
System variables are pre-defined variables in Captivate.
For example,
User variables are defined by the user. These variables can also be made to accept a set of values, and reject the other entries.
For example, you can define a variable 'fruit' to accept fruits as values. You can also restrict the values accepted by the 'fruit' variable by specifying that the entries be one of apples, oranges, grapes, or bananas. This helps you in collecting values in the variable which are of interest to you.
When you add a Text Entry Box to the slide, Captivate automatically assigns a variable to it.
To learn more on variables, see the article Adobe Captivate variables.
You can create user variables in your Captivate project by choosing Variables in the Project menu. This opens up the Variables dialog box. To create a new user variable, click open Add New to the right of Type drop-down box. It's a good practice to name the variables in a way which helps you identify its function later on. You can also enter an initial value to the variable in the Value field.
In Captivate, system variables cannot be modified or deleted, and user variable names cannot be changed once created.
The name you assign to a user variable must not conflict with Captivate’s internal functions, reserved keywords, exposed system variables, or other hidden variables.
There are some conventions while naming a variable. They are:
Example: Naming variables as 1Name, _Name is a bad practice.
For example, avoid using the keywords like: class, while, case, float.
Example: MyVar1, MyVar2
Example: Input_Name, Display_Education
Example: Input_Name variable accepts name entered by the candidates.
To see the list of reserved keywords in Captivate, see the article How to create user-defined variables in Adobe Captivate.
An Advanced Action allows you to execute an action when an event is triggered, or when a condition or set of conditions are met.
To open Advanced Actions, go to Project menu, Advanced Actions. You get the user interface shown below.
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. |
Standard actions allow you to execute an action when an event is triggered.
As an example, implement a Standard action to welcome the users when they enter their name in the course you create.
Open a blank project and add a content slide.
Add a text entry box and a text caption from the Text menu.
Delete the Submit button which opens up along with the text entry box and add a standard button. This is done so because the button which comes along with the text entry box cannot be hidden from the slide during runtime. Rename the added standard button as Submit.
Edit the text caption as Enter your name in the box below and press enter to start the course.
Select the text entry box, go to the Properties Inspector, Properties tab, Style section and click the [X] icon against Variable to open the Variable Name dialog box.
In the Variable Name dialog box, enter the variable name as Candidate_Name. You are not just creating a variable but also associating the variable with the text entry box by doing this step.
Add two text captions to the slide from the Text menu. Make both these captions invisible in the output by using the eye icon left to the caption name under the Properties tab of Properties Inspector.
Rename one of these captions as Welcome to the course,
The second text caption added to the slide in the previous step will be used to call the variable Candidate_Name to display the name entered by the user. Click into the text caption to enable the Insert variable [X] button in the Properties Inspector, Properties tab, Character section under Style.
In the Insert Variable dialog box, select the variable Candidate_Name against the Variables drop-down list.
When you do this step, the default text caption changes to $$Candidate_Name$$ to denote that the Candidate_Name variable is called from this text caption.
You can also call the variable by directly changing the text of the caption to the variable name and preceding and succeeding it by $$. But best practice to call the variable is by clicking the [X] icon and opening the Insert Variable dialog box as this allows you to control the maximum length of the variable value to be displayed.
Select the text entry box added in step 2, go to Properties Inspector, Properties tab, Actions section, and in the On Success drop-down list, select Execute Advanced Actions.
Click the folder icon against the Script drop-down list below On Success to open up the Advanced Actions dialog box. Enter the actions in the image below by clicking into the rows of the dialog box, and enter the Action Name as AdvAction_Show_Name.
To view this project in action, run preview.
Conditional actions, as the name suggests, are executed only when a condition or set of conditions are met.
Check the Conditional Tab in the Advanced Actions dialog box to set the condition and the corresponding action.
If..else logic is:
As an example, you can set up a conditional action to display a text caption to welcome a candidate if their age is greater than 15, and to display a deny-entry caption otherwise.
While logic is a conditional loop that evaluates a condition at the beginning of a statement, and continues to loop a set of actions until the condition or set of conditions is true or false.
As an example, you can set a criterion for an eLearning course eligibility that while the candidate is a graduate and their experience is greater than or equal to 5 years, accept the candidate.
This project implements conditional actions to share some interesting information about the planets in our solar system.
Open a blank project and add nine content slides. Delete the default title slide.
Add three text captions and a text entry box to the first content slide.
In the second slide, add a rectangle from the Shapes menu, a text caption from the Text menu, and a button from the Interactions menu.
Repeat step 3 to add a planet each to the rest of the slides. In the sample project given to you, the planets have been added in sequence according to their distance from the sun. Make sure to rename the elements added to the slide appropriately.
Create a condition that if the users enter a planet name, they are taken to the slide which contains that planet's information. And if they enter the spelling incorrectly or doesn't start the name in uppercase, an error message is displayed.
To achieve this logic, an Advanced Action has to be set up for the text entry box added to the first slide.
Select the first slide in the Filmstrip, go to Properties Inspector, Properties tab, Actions section, and select On Enter as Hide. In the Hide drop-down, select the text caption which contains the error message. This removes the error message when the user enters the first slide for exploring more planets, after a sequence of bad and successful attempts.
To see the project in runtime, preview the project.
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, when you click a button, an Advanced Action containing a piece of JavaScript code executes producing the desired result.
Launch the Advanced Actions dialog box and assign Execute JavaScript as action and write the following snippet in the Script_Window to get the current frame of the movie:
alert(window.cpAPIInterface.getCurrentFrame());
When you preview the above Advanced Action on a browser, you get the result as follows.
For more information, see Common JavaScript interface of Captivate.
If you want to use an Advanced Action in other parts of the same project, or in a different project, you can save it as a Shared Action.
For example, as an eLearning author, you have to repeatedly use an Advanced Action to welcome the candidates to the courses you create. Let's save the Advanced Action created in the section Standard Actions as a Shared Action and open it in a new project.
Open the project created in the section Standard Actions.
Open the Advanced Actions dialog box and open the existing action AdvAction_Show_Name.
Save it as a Shared Action by clicking Save As Shared Action button at the bottom of the dialog box. The Save as Shared Action dialog box opens up.
In the dialog box, name this Shared Action as SharedAction_Show_Name. You can see that all the elements involved in AdvAction_Show_Name show up under Parameter Values. Enter a description against each parameter to identify its function. Description is important to understand the purpose of these parameters when you use them later. Also give a description to the Shared Action. Save the Action (see the image below).
In the Advanced Actions dialog box, click the Export icon in the upper right corner (see the image below). It opens the dialog box for you to save the action as a file on to your device.
Open a blank project, go to the Project menu and open Advanced Actions.
Click the Import icon in the upper right of the Advanced Actions dialog box. Browse and locate the saved Shared Action file and import it.
Repeat steps 1 - 8 of the section Standard Actions and customize the names of the added elements.
Select the Text Entry Box and go to the Actions section under Properties tab of Properties Inspector. Select On Success as Execute Shared Action. There is a {P} icon against this option. Click this icon and it opens up the Shared Actions Parameters dialog box.
Supply parameter values to the imported parameters. Parameter values to be entered are the elements you added to the new project. By doing so, you are associating the elements in the new project with the Shared Action.
To see the Shared Action in runtime, preview the project.
For more information on Advanced Actions, see the article Advanced actions in Adobe Captivate.
כניסה לחשבון