Play/Pause Button extended (Classic Captivate)

Intro

This blog post is due to a forum question. For a custom Play/Pause button the developer tried the workflow from this post. However there was a second request: the learner was expected to click an interactive object to proceed to the next slide. The original conditional action for the Play/Pause button results in a conflict: if the learner clicks that button multiple times, the Play action can override the pausing point of the interactive object meant to pause the slide indefinitely until the learner clicks it to proceed to the next slide. If you want to learn more details, please check out this thread.

My promise: a workflow, taking into account that it should be possible to use it on multiple slides. You can test it out in the Example project. Maybe some of you could be in the same situation, hence this blog post. It is based on deep understanding of Captivate's Timeline, micro-navigation, power of shared actions and objects timed for the rest of the project. 

If you are wondering: this workflow is impossible in the new version 12 for multiple reasons.

Example project

Please test this project, either by watching it using this link for a scalable version, or the static resolution version embedded below. After the introductury slides you'll find two slides with the Play/Pause button. Test them by clicking that button multiple times and watch what happens when you reach the end of the slide: the button will change its state but the play head will remain paused until you click the

 Next button.   I used some design elements/slides from the non-

responsive Quick Start Project 'League'.


Background

The basic conditional action for the custom Play/Pause button, which is timed for the rest of the project to start with is:

I used the simple commands Pause and Continue, which have exactly the same result as assigning values to cpCmndPause/cpCmndResume. Toggling those variables alhough they are Booleans, is not possible (sorry). I preferred the 'Go to Next State' for the PlayPause button. This is the object state panel of the button, this command is toggling between the two states.

Due to the timing of the button for the rest of the project, it has always the same ID and the advanced conditional action has nothing which changes when being on another slide. Problem is that when the button is clicked to the Play state on the pausing point of the Next button, the Continue command will override the pausing by this button. To solve this we need to know 'where' that pausing point is, and add a new decision to the conditional action, where Pause occurs in that situation even when the learner clicks to play again.

If you have an instance of the Next button on each slide, to time it near the end of the slide, its pausing point will be at a different frame on each slide. In the example project, to simplify, I timed the Next button for the rest of the project and took out its Pausing behavior. But I added a click box on each slide, pausing at the end of the slide. The click box is invisible (no feedback messages) to the learner. 

I need to define on which frame the slide has to pause indefinitely. In order to keep the Play/Pause button action independently from that frame, I have to store it in a user variable. The value of that user variable will be defined using the On Enter slide event. 

Step-by-step workflow

Variables

System variables

The used system variables are:

  • cpCmndPause: has value 1 when slide is paused, value 0 when it is not paused.
  • cpInfoCurrentFrame: frame number of the present frame, index starts with 0; frame number is over the project not the slide.
  • cpInfoFPS: number of frames per second; default value is 30 but can be changed.

User variables

Two user variables will be used but since they both appear in a Shared action, they'll be defined when you send this shared action to a new project:

  • v_start: will store the frame number of the first frame of the slide
  • v_end: will store the frame number of the frame where you want to pause indefinitely; it will be near the end of the slide, but it doesn't need to be the last frame.

Events and actions

You'll see an overview of the actions on the two slides where the Play/Pause button is important in the Advanced Interaction panel::

PlayPauseAct (advanced action)

This action is triggered by the Success event of the Play/Pause button:
The second decision is simple: The play head will always be paused when the frame number is higher than the on in v_end. Due to the sequence of the decisions, the state change for the button will occur, but Continue will be overridden if the second condition is fulfilled.

EnterAct (shared action)

This Shared action is triggered by the On Enter event of each slide, has 3 parameters:
The first parameter is the one who will be different on each slide. In the screenshot it is set at 18 seconds. It means that once the playhead reaches the frame at 18 seconds it will be paused by the second decision in the PlayPauseAct. Since frame numbers are on project level, the first frame of the slide is used as reference. The Expression commands are needed to perform some math operation to calculate the exact frame number. This literal depends on the Timeline. Have a look at the Timeline of slide 4
For this slide the first parameter was set at 45 seconds:
For slide 5 this was the Timeline:
In this case the first parameter was set at 9 seconds.

On the last slide (6) I used the On Enter event to hide the Play/Pause and the Next button since they were no longer needed. 




Software Assessment: different failure messages/attempts

Intro

Thanks to a question on the Adobe forum: ‘How to have two different Failure messages for click boxes in a software simulation, assessment mode?’, I created a sample project showing the solution, and will explain the workflow step-by-step. It has become a pretty long article, be prepared.

At this moment multiple Failure messages  (up  to 3) depending on the number of the attempt, are only possible for question slides. A click box nor a button have that functionality. Moreover interactive objects, question slides, Drag&Drop slides have only two events to trigger an action: Success and Last Attempt. This means that you cannot use the first attempt to change a situation at all. Of course you could add events using JavaScript or InfoSemantics CpExtra widget. I accepted the challenge to try to figure this out only with Captivate’s features.

Example project

Watch this project either with the embedded fixed resolution version below, or by clicking this link for a rescalable one (recommended).



Step-by-step workflow

Slide setup

Have a look at the Timeline of the first slide with a scored click box:

From bottom to top you have

  • A shape button, labeled ‘SB_Back2’ (because this was slide 2 in the project). That interactive object covers the complete slide and needs to be at the bottom, behind the original click box. This means that such a workflow is impossible in a fluid box where stacking is prohibited. It may seem better to create a SVG (used as button) which has a ‘hole’ corresponding with the original click box. However that would be a lot of work, since that click box will be in another location on all slides. Only the Success event of this shape button will be used, and you can leave the number of attempts at Infinite or 1, doesn’t matter.
    Check the screenshot of the Properties, Actions tab: the Success message which appears when the Back button is clicked will act as First Failure message. You may call this ‘cheating’.
    This back button is triggering a shared action labeled ‘BackAct’.
  • The shape ‘SS_Hint’ has no role in the workflow, was in this assessment as help.
  • CB_Assess is the original click box inserted in the software sim, assessment mode. The OP provided 2 attempts, but that has to be changed to 1 (see further). I deactivated the Failure message, and kept only the Success message. You see the Properties of this click box to the right. I didn’t use the Failure message, but replaced it by a multistate shape.
    The action On Success is to proceed to the next slide with the next action to be done by the learner. Since there is only one attempt, the Last Attempt action is a Failure action. It is an advanced action ‘FailAct’.

    It is impossible to have states for the default feedback messages of interactive objects. You can see in the Timeline that this multistate shape is labeled SS_Failure and that it is displayed for the rest of the project, always on top. Its visibility is triggered by state changes.

  • The Failure message, which is the second message, is labeled ‘SS_Failure’ and you see the two states in this screenshot. The Normal state is completely transparent and has not text. The state ‘Second’ has the failure message, and the multistate object will be hidden until the ‘second’ Failure attempt happens. 

Actions

FailAct  (Advanced action)

This action is triggered by the Last Attempt event of the Click box. 

The Failure shape is shown, and will have the Second state in place (see below in the shared action ‘BackAct’. Since it is not a default feedback message, it will not appear automatically nor leave the slide paused for 3 seconds as will be the case for the Success message. That is the reason for the Delay command, followed by navigation to the next slide.

You see that this advanced action will be the same for all the click boxes, because of the Timing of the SS_Failure message for the rest of the project.

BackAct (Shared action)

This action is triggered by the Success event of the shape button SB_Back2. 

Because there are so many instances of that shape button, I largely prefer using a shared action over duplicated edited advanced actions. In the next part (other slides) you’ll see how to avoid having to enter the parameters on each slide. Here is the screenshot of that action, with the indication of its parameters:

The state of the Failure message will be changed to show the ‘second’ message when the click box is not correctly clicked. To allow such a failure you need to hide the back shape button so that a click outside of the click box is possible. But since you don’t want the Failure message to appear right away, you need to hide it. As you could see it will be made visible with the Last Attempt advanced action. Sequence of the actions is very important here: you need to change the state before hiding.

ResetAct (Shared action)

This action will be triggered On Enter for each slide with a scored click box. Since the OP provided multiple attempts on quiz level, I needed also to take into account that the slide will be revisited and custom objects have to be reset in their original status. Custom objects are the shape Back button (SB_Backx) and the multistate shape used for the second Failure message (SS_Failure). That explains why I preferred a shared action with these three parameters:

This is the screenshot of the action with parameters filled in for the first slide:

Slides setup (after first slide)

1. Slides with a Click Box

  • SS_Failure: since this shape is timed for the rest of the project, you don’t have to do anything on slides with a click box.
  • SB_Backx: the shape button covering the slide. I recommend to copy/paste SB_Back2 from the slide with the first click box, having the Shared action ‘FailAct’ applied to it. Take the time to rename the new copy which will have a generic name starting with SB_Back. I prefer to just change the number to the slide number. It is very important that you send this new instance to the Back, using either the right-click menu, Arrange or the Align toolbar, Arrange options.

    The attached shared action will be edited automatically to use the correct Back button for the slide.

  • EnterAct: needs to be applied manually to the slide. There is no workaround, you’ll need to choose the correct parameters. Only the first parameter (SB_Backs) is different, both the failure message and its state are always the same.

2. Slides with Text Entry Boxes, FMR or Video Demo slides, Static slides, Results slide

The two failure messages were only needed for the click boxes. You’ll need a simple On Enter action to make sure that the Failure shape has been hidden. With static slides I mean the very short slides which sometimes appear during capture and eventually intermediate explanation slides. You can use the Advanced Interaction panel to help with this setup. Here is an example of this panel for some slides:

Watch the labeling of the Shape back buttons on slides with Click boxes, and the applied actions to the Back button, the Click box and On Enter.

Slide 7 has a Text Entry box and shows the simple State action to hide the Failure message.

This project had 26 interactive objects, Click boxes and Text Entry Boxes. Each of them has a score of 1pt, which leads to the total score showing at the top. It is that score which is stored in the quizzing system variable cpQuizInfoTotalProjectPoints/cpQuizInfoTotalQuizPoints and is used for calculating the displayed fields on the Results slide.

Conclusion

My apologies for this rather long blog post, where I tried to explain the full workflow in detail. A simple question, however with not a real simple answer, agreed? Questions are always welcome. Post them in the comment.

Tip 5: Parameters (Shared Actions)

Intro

First 4 tips in this series were valid for both Advanced and Shared actions. 

This blog is only for Shared actions, which are still not very popular amongst the Captivate developers. In my workshop at the Adobe eLearning World Conference I have demonstrated their power, even for unexpected uses. For each action I develop in my projects I always take a little time to reflect on this question 'Will this be useful as Shared action'? Result is that more than half of my actions end up to be Shared, not Advanced actions. My Libraries with useful shared actions are growing all the time, and have saved me already many hours of work.

In this article I will focus on tips for choosing Parameters to make the shared actions as flexible as possible. When saving an action as Shared action, you get a dialog box where compulsory and candidate parameters will appear:

  • Compulsory parameters: include all objects, audio clips, states... which you have in the advanced action dialog box, with the exception of literals and variables. You recognize them by the appearance of a yellow exclamation sign. When you add a description to such a line and indicate something as placeholder for the parameter the yellow sign is replaced by a green checkmark.
  • Candidate parameters: are the literals and variables which you find in a condition, or in commands like Increment. They get a green checkmark, but by using the checkbox you can convert them to parameters as well. 

Here is a screenshot of the dialog box for a toggle button. You'll see the compulsory and candidate parameters.  Description for the compulsory parameters has not yet been typed:

General Tips

Using several instances of one shared action to replace duplicate advanced actions leads normally to smoother projects, less risk of choking Captivate and even lower file size. However it is important to keep the number of parameters to assign on each instance not too high. Personally my goal is to have a maximum of 6-7 parameters. If you really need more of them, but appreciate the ease of transferring shared actions to new projects, remember that you can use each shared action as template for advanced actions. You can use that knowledge to create duplicate advanced actions if the number of parameters is too high. Labeling (see Tip 1) remains very important as well, because of the filtering (Tip 2) which is possible in the dropdown lists for parameters. You'll find some more tips below for the two types of parameters.

Compulsory parameters

Depending on the action using those parameters, they are either very specific (only one type) or they can be flexible and cover more than one type. Examples:

Show/Hide actions: they can aim at lot of object types. All graphics (bitmap or SVG), video, but also audio objects (invisible objects which have audio attached), learning interactions, but also Groups! These are probably the most flexible actions, and you may consider to replace a multistate object approach by Show/Hide for that reason.

Change State: not so flexible, they need always two parameters which are the multistate object and the state. Whenever possible try to use 

Go to Next State/Go to Previous State: you only need the multistate object as parameter

Assign can be used with 0, 1 or 2 parameters. You need 0 parameters if using two variables which are not defined as parameters, 1 if you have a literal which is no parameter or one variable defined as parameter, 2 if you have both literals/variables defined as parameters. 

Toggle: can only be used for Boolean variables, better choice than Assign because you have 0 or 1 parameter (the variable which could be defined as parameter).

Play Audio: needs an audio clip as parameter.

Apply Effect: only the object or group to which you want to apply the effect can be a parameter, not the effect itself. In most cases you'll want to use a custom effect to have the correct setup parameters.

Candidate parameters

Candidate parameters are variables and literals.  They appear in conditions, both for IF and WHILE setup, but also in the commands Assign, Increment, Decrement, Expression. 

Variables

If a variable in a shared action is not defined as a parameter, it will automatically be created when you import the shared action to a new project, including its Default value and description. One of the shared actions in my actions library is meant to avoid having to create much used variables in new projects. See this screenshot:

I also use that action as template for the many Reset actions needed On Enter for slides.

When you define a variable as parameter, this automatic creation will not happen!

Before defining a variable as parameter, you need to check if that variable is used multiple times in the action. Know that when assigning a variable to the parameter, it will replace that variable wherever it has been used in the action. I will try to explain by an example. If you ever created an advanced action for 'Forced View', where the appearance of a Next button is postponed until all clickable objects on the slide have been used at least once, this action for the first clickable object will look familiar:

In this project, the first clickable object is SV_Decision.  That object has a custom state showing Info, and acts as a toggle button. On a second click the Normal state will re-appear. Its tracking variable is v_1, a Boolean, which will get the value 1 on each click. On the slide 4 of those buttons need to be clicked.  For the three other buttons both the name of the button and the tracking variable need to be edited in a duplicate advanced action. The second decision checks the 4 tracking variables, shows the Next button if all have the value 1.

In this setup you cannot convert this action to a shared action. It would need 3 parameters:  the Next button, the button itself and the tracking variable. But if you replace the first variable by the second variable, that will also happen in the second decision, thus leading to a non-functional second decision where only 3 variables are checked. Have a look at this action:

In this action 2 extra variables are used:

  • v_counter: will be incremented only on the first click; that makes the third checking decision easier, and the tracking variable v_1 which appears twice can be replaced by any other tracking variable.
  • v_max: instead of the literal '4' this new variable makes the action more flexible. It can be used for any number of clickable objects on the slide. The value of v_max (4 in this case) can be assigned either directly in the Variables dialog box, or with the On enter action of the slide. You could also define that variable as parameter if you prefer.

Literals

Be very careful with literals as parameters. My replacing it by a variable in the previous example gives you a possible workaround. Especially if you have multiple literals in an action, defining them as parameters can lead to issues.  Look at this variant on the same situation described above:

It could be possible to define the value '4' in the last decision as a parameter, so that you can use the action for any number of clickable objects (alternative for the variable v_max). However, if you should define the '1' as parameter, changing it in an instance of a shared action would lead to changing it in 3 locations of the action! 

My recommendation: avoid defining literals as parameters!




Memory game setup - version 2021

Intro

As new year's blog I offered a simple memory game in this portal

Let 's Play and Dream

The setup however is not explained in the blog. Since another user asked about the creation of such a memory game, this blog will explain shortly the workflow. It will be limited to the game itself, not to the consequences of having succeeded it.

Setup slide

Besides the use of ONE shared action and ONE advanced reset action, all is based on using multistate objects, groups and variables. It can easily be extended to more than 6 pairs as in the example file. The background image, which in this case is only a static image of all the small images, can be replaced by another image (or a random image if you use JS), which can be included in the game itself. To see what I mean, I have to refer to my first version of this game, 10 years ago: 

Concentration game created exclusively with Captivate

If you want to play that old game, I warn that it is a SWF.

Timeline

Have a look at the timeline of the game slide

The two buttons with the same back image are in a group. There are 12 buttons, so you end up with 6 groups. The buttons themselves indicate where they are. The expanded group Gr_6 has the second button on the third row and the fourth button on the second row.  However you can set up labels as you want.

Each button is a multistate object. Normal state is the symbol for the virus, the Back state has the image. 

Variables

Each group has a tracking variable: v_1 - v_6. Their default value is 0.

The variable v_click starts with a default value of 0. It will track the button clicks (first or second).

The variable v_counter will track the number of correct paired images. It starts at 0, and the game is finished when reaching 6.

The variable v_first is needed to reset the slide, will store the frame number of the first slide frame. For more information check: Replay or Reset?

Shared action 'ButtonAct'

This action is triggered by the 12 buttons, and has only 3 parameters as you can see in the preview of the action:

You see 4 decisions:

Always  is a standard action, it shows the back state of the clicked button and disables it. The tracking variable for the group and v_click are both incremented by 1.

WrongAct (conditional) checks if this is a second click, and it didn't match the first click (because v_1 is equal to 1). In that case the Reset workflow is used. The advanced action 'EnterGame' (see below) will reset what is necessary.

CorrectAct (conditional) if both clicks pointed to the same image, the variable v_counter is incremented. The group with the two buttons will be hidden, to reveal the background image. 

Done: (conditional) checks the value of the variable v_counter and navigates to the conclusion slide if it reaches the value 6, which means the game has been completed successfully.

Advanced action EnterGame

This action is essentially resetting the slide. 

 Since buttons can have been disabled (see ButtonAct) all buttons need to be enabled. A group tracking variable can have a value 1, needs to be reset to 0. The variable v_click needs to be reset to 0 as well. The only variable keeping its value is v_counter.

Extension tips?

More possibilities will not need a lot of work. If you want to reuse the workflow in more projects a shared action has a lot of advantages.  If you import that action in a new project, the variables v_counter, v_first and v_click will be created automatically including their default value and description. Personally I would use the present advanced action ‘EnterGame’ to create a new shared action, keeping only the variables to reset, not the buttons. If you import that new shared actions at the same time as the first shared action, you don’t have to create the group tracking variables neither. You only have to set up the multistate objects and the groups in the slide.

Want less or more groups? 

It is logical that you’ll need to edit the EnterGame action. What about the Shared action ButtonAct?  Since I wanted to make the workflow simple, I kept the literal ‘6’ for the number of groups. Two possibilities for editing:

Use the Shared action to create an advanced action. Delete the shared action in the Library. Edit the literal to the wanted number, and recreate the shared action. You can even use the same original name.

If you want to reuse this action in multiple projects, replace the literal by a variable (v_max) which you can edit in the variables dialog, or by adding an Assign command on a slide preceding the game slide. 

Background image can be replaced, as I mentioned above.

It is also possible to create a more complicated game, maybe with groups of 3 buttons to match. 

Have fun!

Who is afraid of ... Shared Actions? Crash course - Lesson 2 (step-by-step)

Intro

You prefer step-by-step workflow for this second lesson over a video. Great. Let us start with this second lesson,  explaining how to use the shared actions from the first project in your project. Believe me: it is as intuitive as the first lesson.

Workflow: (re)Use shared actions in your projects

Step 1: Preparation

To follow this workflow, you need a project with at least two slides:

  1. Content on the first slide is not important, it is meant to allow you to test the project.
  2. Second slide needs to have these objects:
    • Two multi-state objects. Content is not important: audio, video, graphics, text or combinations in the states. Only requirement: same number of states in both objects (although you can have some identical states). They are labeled Container1/SVGContainer in the Timeline below.
    •  A shape or caption which will be used to insert the variable v_counter. You will insert the variable later on. Labeled SS_Counter in the Timeline.
    • Two navigation buttons: Next and Back. They are labeled SB_Back and SB_Next in my project (shape buttons)
    • A button to jump back to slide 1, with the action ‘Jump to slide 1’ or ‘Go to Previous Slide’. I used a SVG as button, labeled SVB_Home.

Here is an example of the Timeline of the project I use, the names are mentioned above::

If you are eager to start but do not have time to create a custom project, you can download this one:
Lesson2Start

Please do not use the SVGs from SVGContainer in your projects. They were extracted from a licensed AI file.

Step 2: Variables

Have a look at the variables, using menu Project, Variables.  The default view will show you the two user variables which are added to each project:

Step 3: Open External Library

Use the File menu, option Import, External Library. You have to point to the original project which has the shared actions on board.  In this case that will be the start project which you used in the previous practice; “SlideShow”.

The project will not open, but its library appears as a floating window in the left top corner of your screen. You will probably need to increase its height, and collapse the Images folder to see the Shared Actions folder clearly. 

You can use any object directly from this external Library in your project. I used the Home button (SVG). However for the Shared Actions, it is better to not use this method. It can be done if there is only one independent shared action, but in this example the three actions are somehow linked due to the used variables.

Step 4: Drag shared actions to project Library

Select the three shared actions in the external Library, and drag them to the project library. They will appear in that library with the Usage set to 0. Be sure to drag all the actions  at once. Reason:  they share some variables. which could lead to the creation of multiple instances of the variables. You will check this in step 5.

Step 5: Check variables

Use Project, Variables and… surprise! The variables used in the shared actions have appeared, including their default value and description

You can now insert the variable v_counter  in the text (see Timeline) SS_Counter, using the X button in the Properties panel, Character part.

The text will look like this:

…. $$v_counter$$

Beware: if you see more than one instance of a variable, it means that you didn’t drag ALL the shared actions at once. In that case, please delete the shared actions, delete the variables and retry Step 4.

Step….

You can now repeat what you learned in the previous lesson: drag the shared actions to the slide and to the navigation buttons, and choose a ‘value’ for the parameters.

Do not forget to test if everything is working as expected. Use F11, Preview HTML I Browser for the best preview.

More?

The step-by-step workflows described in this and the previous blog (or in the video and the next video to be published soon)) can be used for all the interactions in the Demo project, provide you have the shared actions. Not only for those rather simple interactions! It is also possible for more complicated projects like the Matchstick game, which I published recently, and for many more use cases.

I sincerely hope that at least some Captivate users will realize possibilities.  Ask an expert to design shared actions which can be used by any Captivate developer,  without having to dive into advanced actions, variables etc. .

I may post an 'epilogue' to this short crash course, listing up some Q&A. If you have a question to contribute, do not hesitate to post it in a comment.

Who is afraid of ... Shared Actions? Crash course Lesson 2 (video)

Preparation

In Lesson 1 you started from an existing project, which had created objects for the Slide show AND shared actions in the project Library. Topic of the lesson: workflow to attach the shared actions to a slide event (On Enter) and to buttons (Success event). Lesson ended with the proposal to create a personal project with two slides. First slide is a title slide with only a Start button (Go to Next slide). Second slide needs two multistate objects. Number of states is not important but has to be the same for both objects (you can have identical states if wished).  Two navigation buttons (Back and Forward) and a button to get back to the first slide and your homework is done.

For this video lesson you need:

  • The original project, which I provided in Lesson 1. If you lost it, here is another link (dropbox)
    SlideShow

  • Your project. If you are really lazy, you download my project as used in the video. Please, do not reuse the SVGs, they are created from a licensed Adobe Stock file. You can use them only for practice the video workflow.
    StartLesson2

Video

You will transfer the shared actions to your custom project, and reuse them.

After finishing the workflow, you can compare your result with 'Lesson2'


Who is afraid of... Shared Actions? Crash course Lesson 1 (video)

Preparation

You have read the introduction and watched the Demo project. This lesson will explain the interaction 'SlideShow' which you did see in the demo. You may download this start project, which has two slides. Exploration is explained in the video:

SlideShowStart

Video

You will be exploring the start file, discovering the shared actions in the Library, and the variables. You will attach the shared action to  a slide event (On Enter) and to button Success events, in both cases you will choose the parameter values.

The result of the completed lesson should look like you can see under this link. I left the playbar for your convenience.

SlideShowEnd

Preparing Lesson 2

Lesson 2 will show how you can transfer and use the shared actions to your project. If you want tot follow, prepare a project:

  • with two slides
  • second slide needs two multistate objects with the same amount of states
  • second slide needs two navigation buttons (back/next) and a home button (jumping to slide 1)




Find the differences (game)

To all readers: best wishes for a healthy and enthralling 2020!

Have some fun with this small game, created from an Adobe Stock image, using Illustrator (for assets) and Captivate 11.5. Again SVGs are used extensively. You can play the embedded game (fixed resolution) but I recommend to play it from this link which is a rescalable version. It may be easier to find the differences, especially if you are using a big screen.


Lot of SVGs, some multistate objects, one shared action, two small advanced actions + two variables. If you follow me since a while you know that I had lot of fun with all my favourite Captivate tools.  I didn't use any Javascript directly (actions are converted to JS on runtime) but I’m sure this can be done with JS as well.

The usual white screen with grey arrow is replaced by a poster image. After the mysterious title slide game, game and end image are all on the second slide.

Setup

Objects and Timeline

SVGs reign as you can see in the screenshot of the Timeline panel of the game slide:

The stacking (z-order) of the objects is important. From bottom to top you see:

  • Two instances of the same image (SV_Correct to the left and SV_NOK to the right.
  • Two text containers which show the two titles (Tx_Correct and Tx_Difference).
  • A click box CB_Wrong: it is important that this click box is below all other interactive objects, and that its pausing point is at the same time as the other ones (here 1.5secs).
  • 7 SVGs functioning as buttons. Those are the correct hotspots (if you want to cheat... look at the labels). They need to be on top of the click box, but the stacking sequence of those SVGs is not important. The Rollover and Down states of those SVGs have been deleted. One custom state 'Down' has been added, which has the Chinese character for 'OK'.
  • A multistate object functioning as progress bar. The Normal state is invisible (Alpha set to 0), and you see all the states in this screenshot:

    Just a note: there are some display problems with SVGs in the present version, and that can make the previous screenshot bit confusing. Although the circles have the same size in all states, they seem to be smaller when more circles are present. Moreover something seems to be wrong with the C4 state: total width seems smaller than for the other states. Reason was that originally that state switched to 'Custom', instead of Original.
    In this case it is very important that the option 'Original' size is forced for each state.
  • A shape 'Cover', which is rectangular filled with Solid dark gray, with Alpha = 70%.
  • Final image 'SV_Eind' (sorry for the Dutch label). 

Variables 

Two user variables were created:

  • v_counter: with a start value of 0, will be incremented when a correct hotspot has been clicked.
  • v_hotspot: will be set to the number of hotspots minus 1; in this case it is set to 6 since there are 7 hotspots.

Advanced Actions

Two advanced actions are used:

EnterGame triggered by the On Enter event of the Game slide

As usual this standard action will prepare the correct situation for the slide:

WrongAct triggered by the Success event of the Click box CB_Wrong

Another rather simple standard action, to let some audio play and have effects with the cover:


Shared Action 'CorrectHotspot' triggered by the SVG buttons (Success event)

The most important script for this game. Several actions happen when a correct hotspot is clicked:

  • An effect is applied to emphasize the clicked SVG, in this example I used a ScaleTo effect.
  • Secondary an audio clip is played (sort of congratulation)
  • The hotspot needs to be disabled, to avoid having it clicked multiple times.
  • To track the number of discovered hotspots, the counter variable needs to be incremented.
  • Progress has to change in the indicator (yellow circles multistate object)
  • When all hotspots have been found, the final image has to appear (with an effect).

This is a Preview of a filled in action, where the 5 necessary parameters are marked in a color rectangle:

None of the candidate parameters need to be a parameter: the two variables (v_counter and v_hotspot) nor the literals. As I have emphasized many times, it can be tricky to define a literal as parameter. In this particular case it could have been possible to indicate the Delay time needed to listen to the audio clip being defined as parameter. That would be necessary if you want to use audio clips with very different lengths for the the individual hotspots. The parameters are visible in this screenshot:

Why shared action instead of duplicate advanced actions?

You can use exactly the same shared action if you have a different number of hotspots (differences). Just edit the action EnterGame to replace the value to be assigned to the variable v_hotspot. It is the reason I replaced the literal '6' by a variable v_hotspot. Several parameters are used multiple times in the shared action: the name of the progress bar, the hotspot, the audio clip. When using duplicate advanced actions you would have to edit quite a lot. 

One of the disadvantages is the fixed status of the applied Effects. If you want another effect, use the shared action as template for an advanced action, replace the effects and save it as a new Shared action. If you are new to shared actions: contrary to advanced actions it is perfectly possible to save a new action with the same name, provided the older one is no longer used.






Sliding Menu

Intro 

This post is meant as an answer to a thread posted in the eLearning community. "I want to create a menu that slides on and off the screen, like a door that moves to the left and right, when the user clicks a button." I invite you to read the comment by Greg Stager who is posting some links to blogs he wrote where JS is used to create slider solutions. As you know, I often try to use only Captivate features to solve similar use cases instead of JS. This is a new example. You'll find a step-by-step workflow to recreate the example I show. The shape (which I use as 'box') is not having a menu, I invite you to (re-)read my post about Hyperlinks for the creation of a Dropdown menu. They are a great way to avoid creating multiple interactive objects in the 'box'. 

If you don't like creating advanced actions, I have an offer at the end of the post to make your life easier...

Example

Watch this short file, only three slides after the 3 seconds long Title slide. They have two buttons (from the Assets panel in 11.5): a Next button on top, and the Slide toggle button below it. You can use the toggle button as many times as you wish on a slide. To restart, refresh the browser.


Step-by-step workflow

Step 0: Next button on master slide

I used only one master slide in this project, which made it easy to put the Next button on that master slide. I kept the default option 'Pause project until user clicks' (Actions tab). That will result in having each slide paused at its last frame.

Step 1: Sliding assets

Two assets have to be created and put on the first slide where you want to use the sliding box:

  • Sliding Box: I used a rectangular shape, labeled SS_slider. You can add content to it, but make sure that you check the Options tab, because you will need both the size and the exact x/y coordinates. Here a screenshot of my setup, since it was in a non-responsive project you see both size and location in px. If it was a responsive project, it would have been in %. Put the box in the wanted position after sliding in.

  • Toggle button (SB_Slider): will be used both for slide in and out. You need to create an extra custom state for this button, I labeled it Out. Remember that Rollover nor Down state can change when you switch from the Normal to the Out state, hence make those states neutral (I did not add text to them).

Time the Sliding Box and the Toggle button for the rest of the project, with the option 'Always on top'. The Timeline of that slide will look like this:


Step 2: Custom Out Effect

Create a time-based effect to get the sliding box out of the stage. Do not use an Exit effect, but a simple motion path. I added an AlphaFromTo effect as well (100% to 0%), and reduced the duration of both effects to 1 second. 

Workflow to save this effect as a custom effect is described in detail in this post. Do use that method after you have done step 3:

Step 3: Create Guides

Show the Rulers (View menu) and create two vertical guides, through the start and end point of the motion path. See this screenshot:

They will be needed to create the In Effect, to be exactly the opposite of the Out effect. Now you can save the custom effect, and take it out from the slider box.

If you didn't use a horizontal motion path, you'll need also horizontal guides. If you need more information about using Guides and Rulers, look at 'Guides Rule'.

Step 4: Move slider box in Out position

Use the guide in the scratch area to move the slider box to the correct position. I mostly use shortcut key (SHIFT or CTRL combined with left arrow) to keep that movement horizontal. For a non-horizontal movement, you use vertical and horizontal guide. You'll see a screenshot of the new position in step 5

Step 5: Custom In Effect

Create this effect using the two guides (or four if you needed also horizontal guides). In the screenshot you see this effect, where I combined a motion path effect with an AlphaFromTo effect (0 to 100%). Save the effect, same as for the Out custom effect. 

Step 6: Hide Slider box

Use the On Enter action of the slide to hide the Slider box. 


Pause

Now comes the hard work: you could skip steps 7-9 and scroll immediately to the bottom for an offer. 

Step 7: Variable v_slider

Create a user variable, which I named v_slider. It will be used to track the status of the Slider box: in or out? Similar logic you'll be able to see for all the Toggle buttons in this older post.

Step 8: Advanced Action ResetSlide

Create this advanced action (conditional):

The items marked by in this action will be parameters if you convert it to a shared action. Beware: the name of the custom effect cannot be a parameter! I used TestIn and TestOut as names, you can replace them by your names if they are different.

Step 9: Advanced Action ToggleSlider

Create this conditional action. Like with the previous actin, I indicated the 4 parameters if converted to a shared action.

 

Step 10: Attach the actions to events

The action ResetSlide has to be triggered by the Success event of the Next button, whereas ToggleSlider has to be linked to the Success event of the toggle button.

Offer

You can obtain the described actions as shared actions for free, including a short explanation of how to use them. You could skip steps 7 to 9, but still have to do the other steps.

How? Visit my website (lilybiri.com), fill in the contact form with your request, and a small comment on my blogs or website. You'll get everything by mail. I probably will post more offers in the near future, if you don't want to hear about them, you can indicate that as well (I am European, respect the GDPR).

Rare Tips for Shared Actions

Intro

It is not a secret that I am a big fan of Shared Actions. A project without at least one shared action is a big exception to me. From what I hear and read, lot of you don't realize how much time you can save with those mysterious action. This short article will offer some ideas where Shared Actions are used for (maybe) a totally different situation than you expect.

1. Creation of Variables

If you are reading this post, it is very likely that you use system variables as well as user variables. Do you create user variables in each project, and include a proper description and eventually default values?  I have a list of variables which I use very often in projects, here are some examples:

  • v_null: an empty variable used to check if Text Entry Boxes remained empty after a learner clicked its Submit button, or to reset the variable associated with a TEB.
  • v_counter: as the name tells to track a number of clicks, attempts....
  • v_visit: for situations where the content of a slide has to be different on a later visit, you want to track if the slide has been visited
  • v_one, v_two, v_three....: number of variables that can be used for different use cases, like tracking clicks on hotspots, finishing chapters...

Knowledge fact: when you import a shared action in another project, variables not defined as parameters, will be created including the description and default value.

I have a shared action with a list of Assign commands, one for each of those often used variables. It doesn't matter what you assign at all. I drag that shared action from my external Library with shared actions to each new project. Variables are ready for use, even as parameters in other shared actions. 

  

2. Shared Action without Parameters

Sounds very strange, because the reusability of a shared action is based on parameters? I already gave a first example of such a parameter-less SA under 1.  It is much safer and easier to transfer a shared action to another project than an advanced action. You use the shared action directly or convert it to an advanced action if you prefer (maybe for more editing). Here is an example:

 I use this action to calculate the reference time in seconds (to be used later in calculations) of a frame, mostly the first or last frame of a slide. Defined as a shared action, it needs no parameters. Once dropped into the project Library, I can use it for any frames where I want a reference time.

3. Shared Action as Template 

You can copy an object or a slide, which has advanced actions attached to a new project. But that is not always working great. If you have navigation in the advanced action 'Jump to Slide', that command will often be reset to 'Continue' if that slide is not found. Same for objects, variables etc. 

Less known is that any shared action can be used as a template to create an advanced action. In the top left of the Advanced Actions dialog box, you are used to see 'Blank' which is the default template for an action. Open the dropdown list, and you'll find all shared actions in the project as extra templates:

Choose one of them, you'll have to fill in the parameters, add a name, edit the commands (delete, add as you want) and save as an advanced action. 

Example: a shared action triggered On Enter for a dashboard, checking a number of tracking variables and showing something special after all variables prove that everything has been visited. You can set up the shared action for 4 variables. If you need less or more variables, convert the action to an advanced action and edit it!

What about you?

Do you use shared actions? Did you like these tips? Do you want to have some training about variables/advanced/shared actions?  I love seeing comments on my posts, and promised: you will always get an answer!