Advanced to Shared Action: Step-By-Step (micro-navigation showcase)

Intro 

After the introduction to Micro-Navigation I explained how to use it for forcing the first view of a slide, and for playing an audio file on first visit. When looking at the resulting advanced actions they are pretty similar in both posts. Moreover you probably will want to use the action on multiple slides in the course, and maybe also in future courses. That sounds like a perfect scenario for conversion of the action to a Shared action. I have been blogging already several times about Shared actions. In the present article I try to explain how to reflect on the use of parameters. Static objects need to be parameters as are states and groups, I label them as 'compulsory'. But Variables and Literals are 'candidate parameters', a well-founded choice for change them in parameters,  can save you lot of time later on. Consider it a good practice example.

Analysis

When comparing the two advanced actions created in the mentioned articles, there is a small difference: the first decision (which is a standard action) has one command extra in the second advanced action (for Audio). For the ForceAct, the number of seconds to be jumped over is directly entered in the Expression command, for the SkipSlideAudio, Assign is used to store the number of seconds in the user variable v_skip. Both versions work well, but personally for a shared action I prefer the one with the extra Assign command.

What are the parameters for the shared action?

For the first decision (labeled Always in both advanced actions):

  •  'Assign v_skip with 16.5': this first command has two candidate parameters, the variable v_skip and the literal 16.5. The variable can be reused on each slide where the action is needed. Both advanced actions used the same variable in the interactive movie. There is no need to promote that variable to a parameter in that case. However the literal '16.5'  is the number of seconds to be jumped, will have a unique value on each slide, it has to be promoted to a parameter. Parameter 1 = literal. You have to be careful with literals: double-check that the same numerical value is not used anywhere else in the action. In this example there is a second literal '1' in the second decision, Increment command. It has to be different from the first parameter, which is the case.

  • 'Expression v_skip = v_skip * cpInfoFPS': the user variable v_skip is no parameter (see above). The system variable cpInfoFPS has never to be replaced by another variable, will be no parameter neither.

  • 'Increment v_visit by 1': the user variable v_visit has to be unique for each slide, as you can see in the action SkipSlideAufio where another variable has been used. This means that we have to promote that variable to a parameter, parameter 2. The literal '1' however will always be the same, no need to turn it into a parameter. We already double-checked that the literal in the first decision was different from 1.

The second decision is conditional:

  • 'IF v_visit is greater than 1': has two candidate parameters as well. We already indicated that v_visit is a parameter. The literal in this case will always be 1, will never be changed and need not to be a parameter.

  • 'Expression cpCmndGotoFrameAnd Resume = cpInfoCurrentFrame + v_skip': has 3 candidate parameters. Above was already decided that v_skip can be reused on each slide, and the system variables will always be the same.

Shared action Skip_Frames

When you choose to save any of the advanced actions used to skip frames as a Shared Action you'll see that all possible parameters are marked as OK. The reason is that there is no compulsory parameter in this action:

As a result of the analysis above, we need to mark to items as parameters: the tracking variable and the number of seconds to be jumped on later visits. The result will look like this. It is important to give a good description not only for the shared action but also for the marked parameters:

You can assign the shared action to all the slides where you want to jump frames on a later visit. You only have to define a tracking variable and estimate the number of seconds to be jumped. Here is one example setup for the slide where audio had to be jumped on later visits:

You can check in the Library for the Usage of the Shared action, much easier than for advanced actions.

Using Skip_Frames in future projects

Want to reuse this action in other projects? The workflow is described in an older blog post. Short summary:

  1. Use File, Import, External Library and point to the project where you created the shared action.
  2. Library will be opened in a floating panel. Look for 'Skip_Frames' in the Shared Actions subfolder and drag it to the Library of the new project.
  3. Because v_skip is not a parameter in the shared action, it will be created automatically, including the description.
  4. You have to create a tracking variable for each slide to which you want to assign the shared action, and define the duration in seconds to be skipped. Ready!








Force First View (micro-navigation)

Intro

This question appears often: how can I force the user to view the slide completely before the Next button appears; but when revisiting the slide the Next button should appear immediately. From a pedagogical point of view, I don't think this will improve the efficiency of the learning, but that is off topic. 

Watch this movie: forcing view is used on the slide with the animated dices. The workflows for the audio slides will be explained in a future blog post.



I will explain my analysis and how to create the needed variables and advanced action.

Analysis

Look at the timeline of the animated dices slide from the movie.

This particular slide is just an example. You see that the Next button (a shape button) appears after the last animation has finished, the learner is forced to watch everything that happens on this slide before the Next button becomes available and learner can proceed. We don't want to put him/her throught the same ordeal when revisiting the slide. Here are three possible workflows:

  1. Create two Next buttons: the one at the end (visible at first visit) and another hidden button, with a timeline that starts from the start of the slide. That second button has to be made visible on second and later visits, whereas the first button will be hidden. Advantage: learner can watch the animations if he wants to, but also skip them by clicking the Next button.
    Problem: this will not be possible in responsive projects with Fluid boxes if you want the two buttons in exactly the same location. Even though they are not timed to appear at the same time, a normal fluid box doesn't allow this.

  2. One Next button, timed from the start of the slide, to be shown/hidden. Use the On Enter event to check tf it is a first visit. If that is the case, hide the Next button, use the command 'Delay Next Actions by....' and enter the time that you want to keep the Next button invisible, then Show the Next button. This looks a good workflow but you have to avoid to offer the possibility to the learner to pause the slide. The Delay command takes not into account any pausing. If  you cannot figure out how to script this solution, send me a note.

  3. Use what you learned about Micro-navigation:  except for the first slide visit, jump directly to the start frame of the Next button's timeline. That means that everything will be in place, animations are finished in this case. Check to have all objects timed for the rest of the slide (CTRL-E).  Since there is no stacking in this workflow, this workflow is also functional for responsive projects developed with Fluid Boxes. Focus of this article  is on this last workflow. Check the Timeline screenshot: the jump should be equivalent with 10secs , start of the Next Button timeline.

All workflows need to track if the learner visits the slide for the first time or not. That can be done by a user variable. We could use a Boolean, or a variable that is incremented with each visit. It is the increment approach that will be used here.

Advanced Action + Variables

The variable that will track the visits got the name v_visit, and a default value of 0. It will be incremented by 1 on each visit. Eventually you can show the number of visits by inserting that variable in a text container:

We have to jump 10secs ahead, which has to be converted to frames.You can use the system variable cpInfoFPS. We'll use another variable v_skip to store the number of frames (that variable could be reused on several slides):

v_skip = cpInfoFPS * 10

The advanced action will have two decisions, as you can see in this Preview:

In the first decision 'Always' which is not conditional, the number of frames is calculated and the tracking variable v_visit is incremented. The second decision 'JumpFrames' is conditional: if it is not the first visit, the playhead will jump as many frames ahead as calculated in v_skip. Since this action is triggered On Enter of the slide, the system variable cpInfoCurrentFrame corresponds with the first frame of the slide.

Afterthoughts

How will you manage if you have a lot of slides that need to get this 'Forced view' action?  What can be reused? Will you duplicate and edit the actions? What has to be edited? Try to find an answer to those questions. Look out for my reflections in two future posts: next one will show that a similar advanced action can be used for another use case, and in a third post I'll explain why this perfect to be converted to a Shared action, how to convert the present advanced to a Shared action to make it as flexible as possible.




Where is Null in CP2017?

Intro

One of my most visited blog posts published 7 years ago (Captivate 5, 5.5)  is Where is Null?

Beware: the embedded movie is a SWF, you need a browser with enabled Flash Player to watch that movie. Everything worked fine for SWF output also in later versions. However it is now partially broken for HTML output in CP9 and CP2017. Several users contacted me to ask for a solution, hence the reason for this new post.

Use Case

The use case can be split up in two phases:

  1. Checking the entry in the Text Entry Boxes): user has to enter something, but it is not to be validated, cannot be empty. Because the way Captivate is treating the value of variables, you need to create an empty variable, which I use to label 'v_null'. If the TEB field(s) is (are) empty, a warning should appear for the user.
    That part described in the old blog post is still valid!  For that reason I will restrict the explanation in this post to one TEB on the slide.
  2. Reactivating the Text Entry Boxes) to allow a new attempt for the learner. Once the Submit button is clicked the TEB is deactivated by default. It is this second part that is no longer functional in recent versions for HTML output.  Focus will be on this second part.

Example Movie

You can watch the example movie by clicking this link

CheckTEB

Workarounds for Reactivating TEB

I propose two workarounds: the first workaround uses the dummy slide as described for another use case in a recent post as Tip 2 (Reset Slide). Since you will re-enter the slide, you can use the On Enter event to restore the initial settings. The second workaround uses micronavigation, which was also used in the original setup. But in this case micronavigation will be not be used to move the playhead before the pausing point of the TEB, but to re-enter the slide.

Solution 1: Using Dummy slide

In the movie this solution is on slide 3, the dummy slide (duration 0,1sec) is slide 2. You see the slide numbers at the bottom in the movie. That is the biggest drawback of this solution, you will have extra slide(s). Three events are used on slide 3:

  • On Enter event triggers the advanced action EnterEmpty which resets the situation when re-entering the slide: clears the TEB associated variable v_MyName, hides a Group Gr_Retry (message + button) which will be shown when the TEB is empty and hides another group Gr_OK (message + Next button) which will be made visible when the TEB has an entry.

  • Success event of the TEB triggers the shared action Check_TEB which is also used in the second workflow. It has 3 parameters: the variable associated with the TEB, what (group or object) has to be shown when the TEB is empty, and what (group or object) has to be shown when the TEB variable has a value. In this case the two last parameters are groups: Gr_Retry and Gr_OK.
  • Success event of the Retry button has the simple action 'Go to Previous Slide'.

Solution 2: Using micronavigation

You see this solution on slide 4. This solution needs one more user variable v_start to store the first frame number of the slide, using the On Enter event of the slide. The Retry button will use this number in combination with the system variable cpCmndGotoFrameAndResume to navigate the playhead to one of the last frames in the previous slide. This will avoid the creation of extra slides as with the first solution But the workflow is a little bit more complicated.  The used events and actions are now:

  • On Enter event triggers the advanced action EnterEmptyBis which resets the situation when re-entering the slide: clears the TEB associated variable v_myName, hides a Group Gr_RetryBis (message + button) which will be shown when the TEB is empty and hides a message  Tx_Welcome_20 (kept the generic name) which will be made visible when the TEB has an entry. It also defines the value of v_start with the current frame number, which will be the first frame of the slide. 

  • Success event of the TEB triggers the shared action Check_TEB  used in the first workflow. It has 3 parameters: the variable associated with the TEB, what (group or object) has to be shown when the TEB is empty, and what (group or object) has to be shown when the TEB variable has a value. In this case third parameter is not a group but the message Tx_Welcome_20.

  • Success event of the Retry button triggers an advanced action RetryAct with two commands: clears the variable v_myName, and calculates the frame number that is 2 frames less than the start frame of the slide. I prefer 2 instead of 1 frame because there could be a small delay which makes v_start equal to the second frame number of the slide.

Roundup

Drawback of both proposed workarounds, compared with the original solution (broken now) is possible flickering when the slide is re-entered. I have tried a lot of ideas to avoid that flickering which is an annoying issue since many versions (if my memory is correct since version 6): transitions (not slide transition which is unsupported for HTML output), Delay command, delay on timeline etc.. 

Drawback of the first workaround is that the total number of slides (cpInfoSlideCount) and the current slide number (cpInfoCurrentSlide) cannot be used directly to indicate slide progress due to the inserted dummy slides.

For the second workaround: if you want to apply this to multiple slides, it is possible to reuse the variable v_start which stores the first frame of each slide. If you use the shared action, the variable v_null is not defined as parameter. That means it will be automatically created when import or drag this action to the Library of a new project. As you probably know I am a big fan of shared actions. Maybe I will post some of my tricks to save time with shared actions. in a future post.





Power of Shared Actions in Captivate

Intro

Shared actions were a new feature in Captivate 7 several years ago. They were improved with Captivate 8.  I never understood why almost no one talks about them, even self-labeled experts seem never to use them. This is a real pity because their power is much underestimated. In most projects I open an external library (have a look at Internal and External Libraries) which has frequently used shared actions. It saves me a lot of time in each project. I will try to summarize in this blog post the results of my almost 5 years of experience with Shared actions. As usual my goal is to get more CP-users to understand when and how to use them.   More users could mean getting enhancement feature requests on the priority list of the developers :)

Example movie (CP2017)

Please watch this movie, one of the examples I will explain at the Adobe Learning Summit, session 202 'Make the most of Captivate's Timeline for Advanced Workflows'. You will see in this movie how one shared action can be used both to skip slide audio on revisiting a slide, or to force to view the entire slide on first visit. This is a use within one project. That action certainly has its place in a common external Library. To have an explanation of the shared action, you'll have to be patient, because I want to give 'First View' to the participants of the session in Las Vegas, 24 October.

Published Tutorials Shared Actions

These posts were published 4 years ago (yes, have over 4 years experience with SA :-)). If you are on CP2017, the screenshots may be a little bit different because of the change to the Advanced Actions dialog box (see AA Dialog in 2017). However the work flow and terminology for Shared actions is still the same.

Use cases

Following on those tutorials I explained a bunch of use cases where shared actions were used. Examples are the way to explore new features, and you'll find a list with links here:

1 (shared) Action  = 5 Toggle Buttons

This blog post has a unique shared action that you'll be ablefor several toggle button in all your projects. The post was written  for Captivate 8. If you are using Fluid Boxes work flow (responsive projects) in CP2017, you can have the toggle buttons in a fluid box on master slides, not timed for the rest of the project (unless in a static fluid box):


Dashboard, using shared actions

The advantage of shared actions when setting up a menu or dashboard

Drag&Drop Tips

When using object actions for Drag&Drop slides, shared actions can be an excellent choice over duplicate advanced actions


Custom Hotspot Questions

Using shared actions to create a custom controlled hotspot question which has lot of advantages over the default type of Hotspot question.


Forcing First View

This is an older version of the Example that you watched above. It did already use Shared actions.

Matchstick Game

Games often need repetitive actions and that means that shared actons are the way to go.


Playing with Captivate 9

Another version of a dashboard created with shared actions, to celebrate the arrival of CP9.

Myths and tips

Strange myths exist about Shared actions. Lot of users believe they are only useful  between projects, not in the same  project. Personally, with the exception of the external library mentioned at the beginning, I always give priority on shared actions within one project over advanced actions if appropriate. If an action is used at least twice in a project, and it is possible to use a shared action, I will not use duplicate advanced actions.

Half-myth is that you cannot edit a shared action. That is partially true. You cannot edit a shared action which is already assigned to events and have it changed automatically. However you can use the original shared action as template to create a new shared action. You will have to assign it to all events after completing the new shared action. At that moment you will appreciate the fact that the shared action appears in the Library and has a Usage button  -  like any other asset. Contrary to advanced actions you can even reuse the same name for a shared action, provided the older action is no longer present in the file. That is one of those annoying things, that you can never reuse a name for an advanced action, even if it has been deleted. Keeping track of Usage of advanced actions is also very cumbersome.

Shared actions cannot replace advanced actions in all circumstances, and they need a different set of mind when preparing the actions. You have to be very careful with the candidate parameters: variables and literals.  I could tell a lot about spectacular results when replacing advanced by shared actions that are set up in an efficient way: courses that couldn't be published anymore because of the number of variables and advanced actions that now run very smoothly, decrease of file size and loading time when using shared instead of advanced actions. Once lot of Captivate users gave me the title 'Queen of Advanced Actions'. At this moment I feel more like the defender of Shared Actions, not the first ignored and underestimated stepchild of Captivate.  Too often I hear comments like: 'I cannot see any advantage in using shared over advanced actions'.  Sorry, but that means you never tried them out. This article proves that I have explored them.... and they are on my top feature list of Adobe Captivate.

Conclusion

I would love to organize an online training with focus on use of shared actions. If you would consider such a course a valuable add-on to your skillset, please send me a message using info@lilybiri.com.



Fluid Boxes and Master slides

Intro


A while ago I published a post explaining the setup of the Quizzing Master slides, compulsory parts of each theme, even the almost empty Blank theme. In this article I will try to explain my experiences using Fluid Boxes on Content Master slides. Most themes shipped with Captivate have several content master slides (exception = Blank theme). Let us first start with the master slides that are not behaving like the content or quiz master slides

Main master slide, Blank and Title master slides

Main Master slide

It is not possible to insert Fluid boxes on the main master slide: the button seems active but both options (Vertical and Horizontal) are dimmed. Objects placed on that Main master slide, and inherited by the daughter master slides, are to be set up using the Position Properties panel. Example: the text container with my name and copyright in the example movie.
However after some more testing on iOS devices, the Position properties set up for those objects are not correctly displayed in portrait mode. 
TIP: at this moment avoid putting objects on the Main master slide, since they don't display at the correct location on some mobile devices.

As you probably know, it is not possible to have shape buttons timed for the rest of the project when you use Fluid boxes. You could put a shape button on the main or one of the other master slides but you cannot control it because it has no ID. In the example movie I preferred to have a Next button on the individual slides, because ton most slides it is hidden until the learner has visited everything. However a toggle shape button for Audio, for CC, for the TOC could be on the Main Master slide. They will not behave like objects in a Fluid box however, but act as defined on the Position Properties panel for size and location.

Blank Master slide 

This master slide has no Fluid boxes by default but you could add them. As I have explained in previous articles, you should prefer to duplicate the master slide for editing, don't edit the original slide because it is used for Powerpoint import and for software simulations.

Title Master slide

That master slide has one Fluid box (parent fluid box) but no child fluid boxes. It is set up as 'Squeeze in a Column', and vertically and horizontally centered. Because the title placeholder is inserted directly in that parent fluid box, you are not able to insert child fluid boxes.  Because each new project, using the default theme White will start automatically with a Title slide, this has caused already many frustrations when starting with the use of Fluid boxes. If you want to use fluid boxes on the first slide, you have to change the master slide from Title to Blank (exception Blank theme which starts with a Blank slide).

TIP: if you want to add objects on the Title master slide, first take out the Title Placeholder, to be able to insert child fluid boxes. Then put back the Title Placeholder in one of the child fluid boxes.

Content master slides

It can be a time saver to use a content slide that has already Fluid boxes. In a future next article I'll explain how to create a custom content master slide with the help of Guides, but for now let us focus on an existing master slide, and see how we can tweak it.
In the example movie, the second slide is based on the Content04 master slide from the Theme 'OldPaper'. I didn't customize the theme, just applied the correction explained in my last post

Look at the setup of the Fluid boxes on the master slide: the parent fluid box (FB_15) has two vertcial child FB's (FB_16 and FB_17). The top one is meant for the Title placeholder: 

The bottom Fluid Box has 4 child FB's, (FB_19,FB_20, FB_21, FB_22), which are set up to wrap Symmetrically (when width is too small, two FB's will move to the next row), and have a padding both vertically and horizontally to have some spacing between the FB's. Each of them has a placeholder for an image.

Example movie

Play with this responsive movie (will open in a new window) which has only 3 slides: Title slide (with inserted Next button, and taking over my name from the main master slide), a slide based on Content04 master slide, with a lot of tweaking, and an End slide. The Next button on the second slide will only appear when you have clicked all available shape buttons and seen all the content. 

Refining slide based on Content master slide

The FB setup on the master slides can be tweaked on a slide based on that master slide. You can remove all fluid boxes, but that is has not much sense. To demonstrate I did a lot of tweaking for the second slide of the movie which you just watched:
  • I deleted the image placeholders


  • I decreased the height of the top fluid box (FB_MS2_16) to 10%, originally it was 15% (edited font style as well)

  • I added a third vertical child FB under the parent FB_MS2_15, it is labeled FB_9
    TIP: this will not affect the master slide, if you use Reset Master Slide button in the Properties panel of the slide, you'll get the original layout


  • That last FB_9 got two horizontal FB's, FB_37 (70% of the width) and FB_38 (30% of the width); the last one will be used for the navigation buttons (Back/Next)

  • The setup for FB_38 is visible in this screenshot
  • Each of the four FB's in the center (FB_19,FB_20, FB_21, FB_22) has no longer any object (see 1) and can be divided in two new vertical child FB's


  • As you can see on the screenshot, the top FB will have the button and explanation text (originally hidden, but cannot be grouped in FB's), the bottom one has an example of the style (also initially hidden).

  • Setup for the top FB's here is visible in this screenshot; for the Shape button ('Normal') the option Maintain Aspect Ratio is kept, but not for the Text container, so that it can change for smaller screen sizes (especially in portrait mode).

More questions?

You will have seen that I always had Rulers and Guides activated. My next blog post will focus on the use of that great tool, which almost no one seems to use?

Sure, I have several advanced actions in that movie, but that was not the goal of this post. No explanations here about those actions.


Playing a dice game, using While loop

Intro

In a previous blog post I explained the ins and outs of the new Advanced Actions dialog box. If you feel confused about my terminology in this more practical blog post, please read that first article. A decision block of type 'While' is totally new in version 2017. It has some similarities with the Conditional decision block (IF, Then, Else) but offers new possibilities as you'll see in this simple game.  The While loop can be used to create a looping sequence of commands. That loop can be infinite, or limited in number of executions, based on one condition or a combination of conditions.  Mohana Das from the Adobe team published recently this article demonstrating the infinite While loop. Please read that article, for users familiar with advanced actions the used condition 'IF 1 is equal to 1' will be easily recognized, since this was the condition needed to create a mimicked standard action decision in older versions. It means that the sequence of commands will continue to be done, since that condition always results in True. In a future blog post, I will offer some tips about breaking such an infinite loop.

The present article  will focus on using the While loop, based on a condition which results in having the commands sequence repeated a limited number of times. It is a very simple game, every object was created within Captivate. One exception: the color shift in the Characters was achieved using roundtripping with Photoshop.

It is not a responsive project, to avoid a too long article (should have to explain setup in fluid boxes with logic of the variables and advanced actions). Maybe in a next article?

Play first!

Download this published folder (HTML5). Sorry, cannot embed it in this post (allows only SWF's and it is not playing well in Flash output). Unzip the folder, launch the index.html file to start playing.  It is a small game: when you click on the Play button, a dice will be rolled and you'll see one of the faces of the dice, indicating a (random) number. The girl is supposed to climb the stairs, she will go up as many steps as the number you won. The goal is to reach the top. When the girl reaches the top of the stairs, clicking on the Play button will result in another scenario, and a Reset button will appear. 
On entering the Game slide you'll see two looping animations, with added randomness and a possibility to stop the the looping. You'll see this action in Preview, but I will not provide details. 

Slide setup - preparations

Have a look at the timeline of the Game slide:
I created the stairs as a freeform shape. That was pretty easy with Guides (see Guides Rule) and Snapping to guides. Of course a better approach would be to create that shape in Illustrator with export to SVG, but it is always a challenge to use only the available Captivate tools.

Dice: this is a multistate object, the normal state is a square shape, for each of the sides circular shapes with a gradient fill are added. Look at  the Object state panel for this object. 
The 3D animated dice has also been created as a group from a lot of shapes.

Effects - Characters
Two custom motion effects were created for the climbing girl. Default effects couldn't be used in the advanced action, because the path had to be edited. Here are two screenshots of the custom effects: Impatience (before starting game) and StepUp  (during play).

The original Character (climbing the stairs) will disappear with a default Exit effect 'Zoom out'. when the top is reached.
The Sticky image that replaces the original one climbing the stairs, will get a default Entrance effect 'Drop in and Bounce'. The text panel in that image is covered with a click box, functioning as a Reset button.
Play button: is a simple transparent button. 

Variables (for game only - more are needed for the start animation)

I created 5 user variables:  
  • v_dice: starts with an empty value, will get a random number between 1 and 6 (using JavaScript, see Playing with Numbers)
  • v_counter: starts with a value=0 and will be used in the condition for the While loop to fix the number of repetitions to match the random number in v_dice
  • v_stair: is a second counter, that will be used to keep track of the total number of steps done. It is needed to know when top is reached. The staircase has 16 steps. It also starts with a value=0.
  • v_null: empty variable (see...) used to reset the v_dice variable after each use of the Play button
  • v_roll: starts with a value=0, will track the number of dice rolls needed to complete the steps; that number appears after the top of the stairs is reached. It is a third counter.

For the EnterGame action a 6th variable v_anim is used.


Events and actions

The three used events for the game are:
  1. Success event of the Play button, it will trigger an advanced action PlayAct
  2. Success event of the Click box (Reset) it will trigger the advanced action ResetAct
  3. On Enter event of the Game slide, which triggers the animations: EnterGame

ResetAct triggered by Click Box

I couldn't use Scenario 2 of the Replay Slide blog post.  There are a couple of reasons, one being that the Game slide was originally the only slide. It is never a good idea to start a project with a complicated On Enter action (as is necessary for the looping animation). The workaround is to have a short dummy slide (mine is 0,2 secs) before the game slide and use this Reset action:
Due to the command 'Continue', the On Enter action of the game slide (second slide) is always executed. At this moment for HTML5 output this is not the case when using micronavigation (as in the blog post about Replay slide).

PlayAct triggered by Play Button

The PlayAct has 3 decision blocks, one of each type: the first decision is a standard action (sequence of commands), the second is a While loop based on a condition and the last decision is an IF condition, in previous versions labeled as a conditional action. Here is the Preview:

Decision 1 'Random'  (standard action)

With this sequence, the 3D dice (animated On Enter) will be hidden and replaced by the static dice in its Normal state.
The one line JavaScript will generate a random number between 1 and 6
  window.cpAPIInterface.setVariableValue("v_dice",Math.floor(Math.random()*(7-1))+1);
I explained the construction of this line in detail in this blog post

The variable v_counter is reset to 0. It is important that this is done before the While loop in the third decision.

Decision 2 'EndCheck' (conditional IF action)

This decision checks if the character has reached the top by comparing the user variable v_stair with the total number of steps (16). Contrary to v_counter, v_stair is only reset to 0 when re-entering the Game slide (using ResetAct).

The Play button is hidden (to avoid disturbing the rest of the sequence) and the static multistate dice.

The original character disappears, is replaced by a group (character + click box + text balloon) with some default effects.

If the condition is not fulfilled (ELSE), which means the top has not yet been reached, the variable v_roll is incremented by 1. 

Decision 3 'ShowNumber' (While loop)

The condition used to limit the execution of the commands in this loop, is a combination of these two (AND):
  1. The number of steps taken by the image cannot go beyond the random number stored in v_dice (see first decision) and
  2. The total number of steps done, stored in v_stair, cannot be greater than 16, number of steps in this staircase.

The commands to be done while that AND combination results in True are:

  • Switching the static dice to the next state (see image of the Object states for this static dice above)
  • Character gets on the next step (using custom effect StepUp, but that name has been changed by Captivate to the name of the effect it was based on 'RightToLeft'.
  • The variable v_counter is incremented, it is this variable which is used in the first condition
  • The variable v_stair is incremented; that variable is not reset by clicking on the Play button, is necessary to check if the top is reached (decision 2 'EndCheck').

EnterGame triggered by the On Enter event

Here is the Preview, let me know if you need more details

Questions?

Fire away. Creating this game was a lot of fun, 'while' exploring 'while' loops. Let your creative juices surge!

Playing with Numbers - part 2

Intro

In the previous blog post I introduced you to the common JS API, and you used the method 'setVariableValue' to populate a variable defined in the Captivate project. That value was a random number generated in the JS window, using the Math.random() and the Math.floor methods. The values were integers, between fixed numbers 10 (included) and 100 (not included). In this second article you'll learn to know a new method 'getVariableValue' from the JS API, which lets you transfer a value to JS. We started with the mathematical operation 'Sum', now we'll switch to 'Subtractions' needing again the command 'Expression'. Because CP cannot handle well negative values, we'll have to take care of that as well.

The progress bar introduced with the Sum exercises, will be continued. You'll see that it is possible to change the state of an object, displayed for the rest of the project, from a slide where that object is not inserted. 

Scenario Subtract Slide

Subtraction will be with two terms, always integers. Whereas in the Sum slide I decided that all terms would have to be between 10 and 100, on this slide the user will be able to choose a Maximum number, and if he wants a Minimum number. The minimum number has already a default value of 10, which can be changed by the user, the maximum number is empty. The Max value needs to be bigger than the Min value, if that is not the case, the Max value will automatically be set to 'Min + 200'.
The same sticky figure (with states) and OK button (with state New) are used as described in the previous post for the Sum slide.
This Subtract slide can only be visited when 5 correct Sum exercises have been done, hence the 5 stars on the progress bar are in place on entering this slide. The progress bar is set to display for the rest of the project, and you can change the state (to 6 or more stars) from this Subtract slide, although the progress bar is not visible in the Timeline. New stars can be added after a correct subtract exercise, and after 10 stars, the Next scenario is executed (same as on Sum slide).
Here is a slide preview, after answering the first correct subtract question:

Used objects

The same multistate objects are used as on the Sum slide (see state panels on previous post):

  • Sticky figure with its states and a motion effect for the minus sign
  • OK button, which changes to a New button after the first exercise
  • Progress bar, which has been displayed for the rest of the project.

In this slide I only used TEB's, which I can control due to the presence of the CpExtra widget (InfoSemantics). The consequence is that this description is only valid for HTML output. For SWF output the TEB can be replaced by a Scrolling Text Interaction:

  • TEB_max accepts only numbers and is empty when starting - associated variable is v_max
  • TEB_min accepts only numbers and has a default value of 10 (changeable)  - associated variable is v_min
  • TEB_result accepts only numbers - associated variable is v_result (reused from sum slide)

Two shape buttons, that are alternatively enabled/disabled:

  • SB_Number is the OK/New button, triggers the advanced conditional action SubtractTerms
  • SB_CheckSubtract is the Check button, triggers the advanced conditional action CheckSubtract
To make the next state of the sticky figure interactive, it is covered by a Click box CB_Next2.

This is the Timeline of the slide:

Variables

Some variables created for the Sum slide are reused:

  • v_one, v_two, v_three, v_four: are reused for the values of the two terms, which will end up in v_one (first term) and v_two; those variables will be reset by the On Enter action of the Subtract slide
  • v_result: will store the result value typed in by the user in TEB_result, has to be reset as well.
  • v_check: will be calculated and used to validate the result given by the learner. 
  • v_progress: is a counter for the correct answers, will be used to change the state of the progress bar; this variable is not reset but starts with the value 5 (end value after the Sum slide)
  • v_null: empty variable used to clear the content of the displayed result for a new sum (see Where is Null?)
  • xprefTEBUpdateFromVariable:  for HTML output, one of the CpExtra variables. When assigning the value 1 to this variable (with CpExtra widget loaded either in the file, or headless) it is possible to change the associated variable of a TEB by an action, and it will be reflected immediately in the TEB. I used this to clear TEB_Result.

New variables are:

  • v_max associated with TEB_max will store the maximum value for the terms

  • v_min associated with TEB_min will store the minimum value for the terms

Advanced Actions

Shared actions were not possible. One Standard advanced action was needed (to reset vars) and two Conditional actions.

EnterSubtract

This very simple standard action, triggered by the On Enter event of the slide, clears several variables that are reused from the Sum slide:

SubtractTerms

This conditional action is triggered by the OK/New button SB_Number. It has 3 decisions:

  1. "CheckCorrect" will compare the values stored in v_max en v_min. If the maximum value is not exceeding the minimum value, the maximum value will be calculated by adding 200 to the minimum value.

  2. "RandomNum" will generate two random numbers and store them in the variables v_three and v_four. Reason is that the last decision will have to put the largest number into v_one and  the smallest in v_two. This could have been checked in the JS script window as well, but I wanted to keep the JS as simple as possible and checked with the last decision. 

  3. "CheckMax" compares the values in v_three and v_four. The largest value will be assigned to v_one, the other to v_two. This decision also calculates the result of the subtraction to be stored in the variable v_check (will be used to check the user's entry).

CheckSubtract

This conditional action is triggered by the check shape button SB_CheckSubtract and has 6 decisions

The first decision 'Checker', will check the entered value (v_result) with the correct value (v_check). It is the only decision with a Then and Else part. For correct answer, the state of the sticky character is changed, the counter (v_progress) is incremented,  the state of the button SB_Number is changed to another state and enabled again, while the button SB_CheckSubtract is disabled. For an incorrect answer, the counter is not incremented, and the sticky character is changed to another state.

The 5 other decisions 'ProgressXxxx' check the value of v_counter and show the appropriate state for the progress bar. The last decision 'ProgressTen' will also change the sticky Character to its state GoNext and enable the click box to proceed to the next slide (subject of the next blog post, with Multiply exercises).


Javascript 

In the previous post you learned to use 'window.cpAPIInterfaceSetVariable (x,y)' method to populate a variable x (to be entered as a string between quotes) with a value y. You calculated y by using a combination of two Math methods in JS: 

  • Math.random() which generates a random number between 0 and 1 (not included)
  • Math.floor() which will convert a decimal number to an integer by rounding it down (cutting off the decimals).

For the sum slide we used a combination of those two methods, to end up with a random number between 10 and 100 (not included):

Math.floor(Math.random()*(100-10)+10))

For the Subtraction, the maximum and minimum values are not fixed, but stored in Captivate variables v_max and v_min. Due to the first decision in SubtractTerms action, we are sure that v_max > v_min. Those value will be transferred to JS variables with the method 'window.cpAPIInterfaceGetVariable(x)' where 'x' is the name of the Captivate variable, entered as a string (between quotes). Example:

var max = window.cpAPIInterfaceGetVariable("v_max");       stores value of v_max in JS variable max

Instead of the fixed values 100 and 10, used for the sum slide, you use this time min and max to generate a random number between min and max. The two random numbers are stored in variables v_first and v_second. Since they are random, we do not know yet which one has the largest value:

var first = Math.floor(Math.random()*(max-min)+min);

var second= Math.floor(Math.random()*(max-min)+min);

You are already familiar with SetVariableValue to store the result of first in v_three - Captivate variable, and second in v_four. 

window.cpAPIInterface.setVariableValue("v_three",first);
window.cpAPIInterface.setVariableValue("v_four",second);


Conclusion

You earned a second star, soon a third part will be ready, up to multiplications and bit more of randomness.

Playing with Numbers - part 1

Intro

How to use Adobe Captivate to create a course for simple calculations, has been popping up on the forums several times. You can use Text Entry Boxes, MCQ's to reach that goal, but that is pretty limiting. Some examples can be found in this older blog post where the real goal was to have the score being linked to the attempts.

I started using JavaScript in Captivate projects since the release of the common API for JS (version 8) whenever the advanced actions did lack the wanted functionality. For those who want to start using JS, I wanted to explain some very simple use cases in a sequence of 4 articles that will focus on the 4 basic operators that are available in the Expression command: sum, subtract, multiply and divide. Each of the posts will introduce a JS example. The Expression command is not available as a simple command from the dropdown list in the Actions tab, it is only available in advanced/shared actions. 

This article will focus on the Sum operator, and introduce JS to make it possible to generate random numbers. You'll also see how to assign that generated number to a Captivate variable with the function setVariableValue from the API. That will allow to use the same slide for several sum questions. I will use the Multi-state object feature of Captivate 9 several times as well. In the next parts you'll also learn about retrieving a Captivate variable value with getVariableValue, how to format a number to specific number of decimals, how to avoid dividing by 0 (zero).

Scenario Summing slide

User will be allowed to choose for sums consisting of 2 up to 4 terms. The number of terms can be changed after completion of one exercise.

For a correct answer, the stick figure will change to another state, and a star will be added to the progress bar (also a multi-state object). For an incorrect answer the stick figure also changes to a state but no star will be ended to the progress bar.

After completion of 5 correct sums, the stick figure will change to a Next button. The user could still add more questions, but no more 'stars' will be added to the progress bar. 

In this screenshot, from HTML output, you'll see the situation after one successful answer, second sum has been created with 4 terms:

Used objects

Multi-state objects

Stick Character: see image Object States in Library below

OK/New shape button: see image Object States in Library below

Progress bar: see image Object States in Library below 

Special objects

Radio buttons - works perfectly for SWF output but formatting is not preserved for HTML output; labeled "Wd_TermNumber"

Scrolling Text interaction for SWF output, labeled "Wd_SumResult". It is possible to change the shown content in this interaction by changing the associated variable (v_result). However that functionality only works for SWF, not for HTML output. For that reason I needed an alternative which is a  

Text Entry Box, labeled "TEB_result" combined with the CpExtra widget and a specific command variable for HTML output. Since there is a bug in Captivate 9, which prevents using a TEB multiple times on a slide, I used a workaround. The default Submit button was deleted. It was replaced by a custom shape button (SB_CheckSum in the timeline) to trigger an advanced action. In this case an easy workaround, since I used that same shape button for the Scrolling Text Interaction for SWF output. The associated variable for the TEB is the same as for the Scrolling Text Interaction (v_result). Nothing had to be changed to the advanced action 'CheckSum' when replacing the Scrolling Text Interaction by a TEB.

Variables

v_one, v_two, v_three, v_four: will get the values for the (possible) 4 terms of the sum which are generated by the advanced action 'SumTerms'

v_result: will store the result value typed in by the user in the Scrolling Text interaction (SWF) or the TEB (HTML)

v_check: will be calculated and used to validate the result given by the learner in the advanced action 'CheckSum'

v_progress: is a counter for the correct answers, will be used to change the state of the progress bar

v_null: empty variable used to clear the content of the displayed result for a new sum (see Where is Null?)

xprefTEBUpdateFromVariable: only for HTML output, one of the CpExtra variables. When assigning the value 1 to this variable (with CpExtra widget loaded either in the file, or headless) it is possible to change the associated variable of a TEB by an action, and it will be reflected immediately in the TEB. I used this to clear the result when defining a new sum.

Advanced Actions

In this particular case it was not possible to use shared actions. Two advanced actions, both conditional, were needed:

SumTerms, triggered by the OK button (SB_Terms) after choosing the number of terms

This conditional action has 4 decisions, the first 'Always' is a mimicked standard action (will always be executed), prepares for a new sum by clearing the result and the terms. It also resets the state of the sticky character.
The three other decisions will show the correct number of terms, based on the choice made by the user. In these decisions, a Javascript command is used to generate random numbers (see later).

CheckSum, triggered by the Check button (SB_CheckSum) to validate the answer

This conditional action has 7 decisions.

The first decision 'Always' will calculate the sum. It doesn't matter that it always sums four terms, since the lacking terms are empty.

The second decision 'Checker', will check the entered value (v_result) with the correct value (v_check). It is the only decision with a Then and Else part. For correct answer, the state of the sticky character is changed, the counter (v_progress) is incremented,  the state of the button SB_Terms is changed to another state and enabled again, while the button SB_CheckSum is disabled. For an incorrect answer, the counter is not incremented, and the sticky character is changed to another state.

The 5 other decisions 'ProgressXxxx' check the value of v_progress and show the appropriate state for the progress bar. The last decision 'ProgressFive' will also change the sticky Character to its state GoNext and enable the click box to proceed to the next slide (subject of the next blog post, with Subtract exercises).

JavaScript for random numbers

In the documentation provide by the Captivate team about using the common JS interface, you'll find a description of creating random numbers:

Common JS Interface

In this example I wanted to generate a random number between 10 included) and 100 (not included). The script window for the decision 'TwoTerms' of the action SumTerms (see above) had to generate two random numbers, to be stored in v_one and v_two; for the decision 'FourTerms' 4 variables had to get a random number:

Short explanation of this code:

The JS method Math.random() generates a decimal number between 0 (included) and 1 (not included).

The multiplication Math.random()*(100-10) will result in a random (decimal) number between 0 (included) and 90 (not included).

The sum Math.random()*(100-10) + 10 will result in a random (decimal) number between 10 (included) and 100 (not included).

The JS method Math.floor(e) will cut off the decimals of the argument e, round iit down to the nearest integer. As a result the full expression used in the JS window  Math.floor(Math.random()*(100-10) + 10) will result in an integer between 10 (included) and 99 (included). 

The method from the common API setVariableValue(x,y) allows to assign the value from the second argument to the variable indicated in the first argument. Beware: the variable name has to be identified as a string (text) by putting it between single or double quotes. For the value, which is a number, you can use the expression explained above. It is a method of the cpAPIInterface which is in the window object. That explains the total line of code, which in JS always ends with a semicolon:
window.cpAPIInterface.setVariableValue("v_one", Math.floor(Math.random()*(100-10) + 10));

Conclusion

You will be able to download the published files - both for SWF and for HTML, when the 4 articles are ready. If you succeeded reaching  this conclusion, you have won your first star!  Three more to go :)











Knowledge Check Slides - tips

Intro

Knowledge Check Slides have been introduced as one of the new quizzing features with version 9. The Help documentation is 'spartan' as usual. You can read this as Features (quote from the Help):

  • Knowledge check slide imbibes similar features of question slide without any results, reporting structure and interaction ids. 
  • Knowledge check slides do not participate in reviews. 
  • Random questions are not applicable to this knowledge check slide. 
  • Master slide and controls usage is similar to question slide. 
  • Knowledge check slides can be used to impart the learning on specific topics. 

I explored those KC slides in preparation for a workshop about new Quizzing features, and want to give you some more tips. Since the KC slides are very similar to normal quiz slides, I'll start with 'Recognizing KC slides'. Then I'll show the differences in default setup, and in some other aspects not mentioned in the Help,  the relationship with the quizzing system variables and - what did you expect? - a tweaking tip.

Recognizing KC slides

This is possible in different locations:
  • in the Filmstrip, KC slides get a special indicator at the bottom right, which the Quiz slides do not have; in this screenshot slides 1&3 are KC slides and have that indicator:
  • in the Quiz Properties panel you see more differences with normal quiz slides, most are due to the fact that KC slides are not scored by default:
  • The mention (KC) next to the type of question
    The lack of the possibility to choose between Graded and Survey (because KC slides are not scored)
    No partial scoring for MCQ slides with multiple correct answers 
    No points
    No penalty

  • in the Advanced Interaction panel you don't see a specific indicator. The score of the KC slides is set to 0,  they are not set to be reported but... contrary to what the Help tells, the KC slides have an individual Interaction ID. This is probably not used. Look at this screenshot:

There is no way to convert a KC slide into a question slide, nor a question slide into a KC slide!

Default setup KC slide

The default settings for a KC slide are bit different from those for a question slide:

  1. For a KC slide only the Incomplete feedback message is activated, not the Correct message as for Quiz slides
  2. For both KC and Question slide only the Submit button is checked off. The Back, Skip and Clear buttons can be activated, but they are not by default.
  3. Attempts are set to Infinite, with the Retry Message enabled. For question slides by default Attempts is set to 1. Because the attempts are set to infinite, you don't have a Failure message enabled for KC slides. You can decrease the attempts and in that case you can provide up to 3 Failure message, same as for Question slides.

You read in the Help that KC slides will not be visited during Review, they are not in the Quiz scope, except of course if they are nested in between normal quiz slides. Contrary to Pretest slides, the KC slides will not prevent navigation by playbar or TOC.

It is not possible to use question pools (see Help), random questions but it is also not possible to use GIFT format to import KC slides. 

Some options in the Quiz Preferences do work for KC-slides: if you check the option to Hide Playbar in Quiz, this will be valid both for question slides and KC slides. Unchecking the option 'Allow Backwards Movement' will only prevent backwards movement on question slides, not on KC slides. However, KC slides do not get a Progress indicator! IIf you want a progress indicator (question X of Y) you can have a look at this older blog post..

When you leave a KC slide, it is reset immediately which is not the case for question slides which are frozen until a new attempt on Quiz level is started. In that way a KC slide behaves like a Drag&Drop slide that is not set to be reported, had no score. There is no possibility to freeze the answer on a KC slide, which may be a game stopper sometimes.

As the Help mentioned, design of the KC slides depends on the same master slides as the normal question slides, with the exception of the new Review buttons which will never appear on KC slides. For navigation on KC slides you can use the Back/Skip buttons or add custom shape buttons.


System variables 

Contrary to the Pretest slides, there are no specific system variables available for Knowledge Check slides. I have been looking for quizzing system variables that do get a value from a KC slide. Here is an overview of the variables that are not used by KC slides:

  • cpInQuizScope and cpInReviewMode, both Booleans will not be toggled from the default 'false' to 'true' when you enter a KC slide. If the KC slide is in between normal question slides, it can be 'true' but that is not due to the KC slides.
  • Variables linked with scoring are not used: cpInfoPercentage, cpQuizInfoLastSlidePointScored, cpQuizInfoNegativePointsOnCurrentQuestionSlide, cpQuizInfoPassFail, cpQuizInfoPointsPerQuestionSlide, cpQuizInfoPointsscored, cpQuizInfoPartialScoringOn, cpQuizInfoTotalProjectPoints, cpQuizInfoTotalQuizPoints 
  • cpQuizInfoAttempts: gives the attempts on Quiz level, as specified in 'Quiz Preferences, Pass or Fail'. Those attempts have no sense for KC slides, since the user can come back as many times as he wants to retake the KC question which is always reset when leaving the slide.
  • cpQuizInfoPassPercent and cpQuizInfoPassPoints: since KC slides have no score, those settings of the Quiz Preferences have no meaning for KC slides.
  • cpQuizInfoTotalQuestionsPerProject: contrary to the Pretest questions which are counted in this variable, as are the normal Question slides, the KC slides are not included in this variable. Same for the variables cpQuizInfoTotalCorrectAnswers, and cpQuizInfoTotalUnansweredQuestions

As you see not many variables are used by KC slides, but some are used! Moreover they can be very useful if you want to do more with KC slides:

  • cpQuizInfoAnswerChoice: one of my favorites as you could read in this old blog postIt can be used to tweak the work flow with KC slides as you'll read more later on. One exception: it is not populated when you use Advanced Answer option.
  • cpQuizInfoMaxAttemptsOnCurrentQuestion: can be useful as well, although having a similar system variable to cpQuizInfoAttempts for current attempt on question level would be even better. You need a user variable as a counter for attempts on question level. If you keep the default setting of Infinite attempts, this variable will have the value 32767 (no idea why?).
  • cpQuizInfoQuestionSlideTiming and cpQuizInfoQuestionSlideType are available for KC slides as well.

Tweaking tips

Here are some tips, which I tried out with success but will not explain in detail.

  1. If you do not want to keep the Attempts set at Infinite, but to a limited number it would be possible to count the number of correctly answered KC slides. Create a user variable v_counter with a default value of 0. Use the Success action of the KC slides to increment that counter. Later on you can show the obtained value for v_counter, and even use that value in a conditional action to offer feedback or navigate the user back to content slides.

  2. There is no Review possibility for KC slides as mentioned. If you offer limited attempts on question level, you could show a custom feedback message on the KC slide for the questions answered correctly, something like 'You have answered this question correctly'. When simulating a 'Review' situation, the user will be invited to answer only the KC questions that do not show that message. Be careful: all embedded question slide objects are always on top of the stack, you don't want the feedback to be hidden by those objects. That can be done by having a shape before the KC slide, timed for the rest of the project and always on top. This tweaking work flow was described in this article: Buttons on Question/Score slides?

  3. The use case described in this thread of the Captivate forums could be solved using the same system variable cpQuizInfoAnswerChoice in conditional actions, combined with a counter to track the number of attemptsl. You cannot leave a normal question slide to a content slide for remediation unless you follow the strict rules for remediation. If you want to limit the attempts to get a correct answer, remediation rules are broken. With a KC slide, the answers are reset every time, which allows a lot more freedom. However: if you need a real score for the slide, you'll have to use the workaround I described in this blog post: Report Custom Questions - part 2









    1 action = 5 Toggle Buttons

    Intro

    In the past I wrote some posts about creating Toggle buttons. The oldest article explained the use of an Expression and a system variable for a button that kept the same style but could turn on/off a functionality (created for versions 5/5.5). My excitement about shape buttons, appearing in version 6, was the inspiration for several scenarios in which the style of the toggle button changed with the on/off situation. 

    When shared actions appeared with Captivate 7, I posted some articles about the difference with advanced actions. Captivate 8 enhanced shared actions by allowing variables and literals as candidate parameters. Although Captivate 9 seems not to add any improvements to shared actions (had hoped secretly for an easier way to edit them), combining shared actions with the new multistate objects will save a lot of time. The use case described here is a good example. Start by watching the example movie to understand my interpretation of Toggle buttons.

    Example movie

    This movie has 4 slides, the third slide shows the toggle buttons. Try them out, there are two instances of the shape button that toggles the visibility of an image or a group. They use a different user variable. Beware: images do overlap on the slide. The other shape buttons are muting/playing audio, showing/hiding Closed Captioning, Table of Content and Playbar. I choose shape buttons over normal buttons because they offer more freedom for styling the InBuilt states. To navigate to the last slide you have to 'toggle' on either the playbar or the TOC for navigation.

    Concept 

    All toggle buttons have in common to be associated with a variable that can be toggled by the developer: I'm talking about Boolean variables, which can have only two logical values '0' (False/No) or '1' (True/Yes). Both system and user variables are possible. On this screenshot you see the Timeline with the 6 shape buttons, labeled to identify their functionality (SB is my indication for Shape Buttons):

    Variables

    The associated variables are in the same sequence as on the timeline, from top to bottom:

    • v_visgrp (user variable with Default value = 0) for SB_visib_group

    • v_visib (user variable with Default value = 0) for SB_visib

    • cpCmndShowPlaybar (system variable with Default value = 1) for SB_Playbar

    • cpCmndTOCVisible (system variable with Default value = 0) for SB_TOC

    • cpCmndCC (system variable with Default value = 0) for SB_CC

    • cpCmndMute (system variable with Default value = 0) for SB_Audio

    This list shows that one of the system variables doesn't have '0' as default value, cpCmndShowPlaybar. Solution for this discrepancy can be found in switching the states for the associate button, or in switching the variable itself to '0', thus hiding the Playbar. I used the second scenario: with the On Enter action for the third slide I did Hide the Playbar, which toggles cpCmndShowPlaybar to 0

    The shared action can be used for any button with such a, associated Boolean variable, system or user variable. Some examples are shown in the last slide of the example movie: cpLockTOC or a user variable to toggle an audio object.

    States

    The shape buttons have three InBuilt states: Normal, Rollover and Down. For each button I added one custom state. That state will change the shape button to show the 'OFF' state, and if necessary additional objects are added in this state. In this screenshot you see the 4 states for the shape button SB_Audio:

    This shape button has a SVG added in each state. At this moment SVG cannot be used as a Fill image for a shape button (maybe in a next version?), they are separate objects. For some states I also changed the style of the shape itself (Fill):

    1. Normal: has a SVG indicating you can mute  audio (since cpCmndMute has a default value of 0, which means that audio is playing)
    2. Rollover: Speaker only (SVG), Fill different
    3. Down: Speaker only (SVG), Fill different
    4. AudioOn: has a SVG indication to play audio; this will be the state that is visible when audio is muted, cpCmndMute = 1.

    The buttons SB_TOC, SB_CC and SB_Playbar have a similar setup: for the InBuilt states text was inserted in the shape. The custom fourth state adds two line objects (cross) over a duplicate of the Normal state. Look at the screenshot for the SB_Playbar:

    Both instances of the Visibility toggle button use SVG's to change the style of the shape button (similar to SB_Audio), but they add other objects for the 4th custom state as you can see here:

    Shared Action

    The action has to be conditional, checking the value of the Boolean variable. Only two commands are needed, both in Then and Else part: to change the state of the shape button itself and to toggle the variable. Toggling the variable between 0 and 1 will switch the functionality between On and Off. If you write this out as an advanced action, in this case for the Audio button, it would look like this:
    When creating a shared action, it is important to identify the parameters. Compulsory parameters in this action are:
    1. the button itself (SB_Audio in the screenshot above)
    2. the state 'Normal' which is used and
    3. the state 'AudioOn' which is used as well

    Candidate parameters are:

    1. The variable cpCmndMute: it has to be a parameter, because we need other Boolean variables for the other buttons
    2. Literal '1': because I choose the 4 th state (custom) for each button with this action in mind, it is not necessary to define this literal as a parameter

    This leads to the definition of the shared action with 4 parameters, the compulsory and one candidate parameter. In this last screenshot you see the parameters with their values for another button, SB_Playbar. Watch the description of the parameters.

    Conclusion

    In many situations using a Captivate playbar is not a good choice, and with states, one single shared action from your script library it is now really simple to create not only Next and Back buttons, but also every other toggle button needed on the course slides. If using shape buttons (as was the case here) you can put them on the first slide of the course, time them for the rest of the project. They will have each a unique ID, which allows you to take control of those shape buttons, to hide them when they are not needed on some slides. Good luck!