June 15, 2017
Making the Most of Adobe Captivate 2017’s WHILE Loop
Comments
(4)
June 15, 2017
Making the Most of Adobe Captivate 2017’s WHILE Loop
I have worked in the eLearning industry for over 15 years. I enjoy making tools/applications/web apps do things they were not meant to do. I have launched several tools to help develop better eLearning. CoursePortfolios.com: Explore demos from the world's best eLearning designers and developers. Where the most creative eLearning professionals share demos of their craft. ReviewMyElearning.com :  The is the best way to collect feedback from SMEs, Team Members, Clients, etc. Plus it's all in the cloud. I use my skills to create custom solutions for Web, Mobile, and Desktop. Primarily in the eLearning arena but we provide solutions for many other industries.
Newbie 17 posts
Followers: 44 people
(4)

Adobe Captivate 2017 is packed with a ton of new features. One that you may have missed is the new WHILE condition in Advanced Actions. Even if you did notice it, you may be wondering: What is the point? Why would I use that? Or, how would I use that? Well how about something like this demo course? Please read on to discover how I built that demo.

WHILE conditions have been used in programming since… well, since there has been programming. The principle idea is to keep your program doing something while a condition exists. An example might be, “The button is blue while the mouse hovers over it.”  Thankfully that logic is already built into Captivate (and most programs). But what about something like, “The alarm will sound while the character is exposed to gases”? Now we can build interactions like that in Captivate.

Before we dig into the more complex example let’s build a simple demo of the WHILE condition. In this example we will build a timer of sorts. Our statement will be, “count upwards while the counter is running”.  We can view the output of this example here.

We begin by creating two variables:

  • “counter” (defaults to 0)
  • “run_counter” (defaults to 1)

Next, we build our Advanced Action.

  1. Create a new Conditional Tab.
  2. Change the type to “While”.
  3. Our only Condition is: “run_counter” is equal to 1.
  4. The only Action is: Increment “counter” by 1.
  5. Name the Action “count_up” and save and close it.

  1. Set the slide On Enter Action to run our new count_up Advanced Action.
  2. Then we display those two variables on the slide so we can watch as the coolness unfolds.

When we preview the slide in the browser you will see that the counter steadily climbs upward, even when the timeline ends or pauses. Captivate runs the WHILE Loop every second so in effect we have just built a timer!

Now to add some complexity to our example we’ll create a few buttons with actions.

  1. Add a button and change the title to “Stop”.
  2. Set its action to Assign run_counter with the value of 0.
  3. Preview the slide in the browser.

Now when we click the stop button the run_counter variable will be set to 0. The next time our WHILE loop runs it will notice that run_counter is no longer equal to 1 and it will stop and exit the loop, which turns off our timer.

Watch the video below to see how to pause, restart, and reset the counter. One of the solutions I demonstrate in the video uses JavaScript to enable an Advanced Action to trigger another Advanced Action. To learn more about that technique see my previous blog post, How to Trigger Captivate Advanced Actions with Javascript.

Now that we have a basic loop running we can use it to perform other actions. Really we can run whatever code we want every second. We can use these loops to run animations, play audio, blink objects, etc. Let your imagination run wild! And, if you would rather run it every five seconds,for example, you could add Captivate’s built-in “Delay Next Actions by” Action.

In the video below I walk through using the WHILE Loop to continuously spin an arrow until the Learner clicks stop. You can view the output of this example here.

Finally, this video will show you how to build a more robust example with multiple conditions in our WHILE Loop. Click here to play with the fun demo.

I hope this post has sparked your imagination and clarified what a WHILE Loop is and when/how you would use it. If so, please share your ideas in the comments below!

James Kingsley has worked in the eLearning Industry for over 15 years. He has won several awards for combining technologies to produce better eLearning. He is an Articulate MVP. James is the Senior Technology Architect for eLearning Brothers and the Co-Founder of ReviewMyElearning.com. You can follow him on Twitter or connect with him on LinkedIn for additional tips and examples.

4 Comments
2018-05-11 19:25:56
2018-05-11 19:25:56

I was wondering if it’s possible to create navgation for an object which would be moved vith arrows, like in a simple game. Thought of adding animation of “path” type and then loop it so that it moves about the slide. Haven’t invented how to do it yet. That would be interesting.

Like
()
2017-06-29 10:26:11
2017-06-29 10:26:11

What type of action and parameters have you used to set this demo?
How do you define which object was dragged 1st, 2nd, etc. and which comes next in order to change the state of the guy?

Like
()
(2)
>
Anonymous
's comment
2017-06-29 14:43:17
2017-06-29 14:43:17
>
Anonymous
's comment

Hi, you can seem most of the actions and variables in the video.
My logic on the drop targets changes the state of the dropped item. I choose which state based on if the suit has already been dropped. And conversely, when the suit is dropped I change the state of any dropped items to match the suit. This way I don’t need to worry about their order.

Like
()
>
James Kingsley
's comment
2017-07-06 05:55:46
2017-07-06 05:55:46
>
James Kingsley
's comment

Hi,

On what you have set the while loop action??

Like
()
Add Comment