Wednesday, January 30, 2013

Interacting with Captivate 5.5 using Flash AS3


Adobe Captivate is a great eLearning development program, but there are some things it can’t do.  In the past few years, they have made substantial progress in expanding the possibilities by including widgets.  Widgets can be purchased (sometimes free), downloaded and used within Captivate to do something more powerful or interactive.  However, if you are working in a corporate or restricted environment, downloading and installing widgets can sometimes range from a policy violation to being totally blocked.  In those situations, it is helpful to know a bit about Flash and write your own Flash files that can be included in Captivate (Insert >> Animation).  While they don’t have the same flexibility as true widgets, these mini-swfs can do things Captivate can’t on it’s own (and get you started with widget development, if that’s the route you want to go. 

Nested?
A swf that you include in a Captivate module as an animation works similarly to a nested movie clip.  Think of the Captivate timeline as the United States.  The state is a holder movieclip, and the city is the swf you have created in Flash.  As such, interacting with the Captivate timeline requires going two levels into the parent – Moveclip(parent.parent).

What can I do there?
Short answer – anything.  Captivate outputs Flash modules.  As such, anything you can do in Flash, you can pretty much do in Captivate.  If you want to do typical Captivate commands like advancing slides or pausing the playhead, check out this post from CPGuru that details all the system variables you can manipulate (like rdcmdPause and rdcmdNextSlide).

Those commands are actually variables, so from your Flash timeline, you need to move two levels up and set them to 1:
Movieclip(parent.parent).rdcmdNextSlide = 1;

***Update***
For Captivate 5.5 and Captivate 6, the following code works, as opposed to the parent.parent method: MovieClip(this.parent.root).rdcmndNextSlide = 1;

In addition to setting the Captivate system variables and triggers, you can also manipulate variables that were originally established in Captivate.  For example, if you have a Flash swf on one page, but want to display different subsequent slides based on the score earned, you could do the following:
Create a passedScore variable in Captivate
In Flash, at the conclusion of your interaction, set:
Movieclip(parent.parent).passedScore = Math.round(intCorrect*100/intTotal);

Captivate 5.5/6: MovieClip(this.parent.root).passedScore = Math.round(intCorrect*100/intTotal);
In Captivate, work with the variable through actions or display it using $$passedScore$$.

Quick example
Recently, I leverages Flash AS3 commands to manipulate a Captivate module when a colleague with no Flash experience needed to create a module that included a drag and drop interaction.  I build the Flash interaction to her design specifications.  Once the learner completes the interaction, the score is passed back to the Captivate module and a button is shown in the Flash module.  Clicking on the button triggers the nextSlide command in Captivate and advances the module that the learner can’t otherwise do.

While it’s a simple use, it allowed for easy division of work and enabled us to provide the module desired to our customer.  We were able to include interactions that aren’t available in Captivate off the shelf.  Drag and drop interactions are fairly straightforward to build in Flash, but creating the remainder of the 30-page module is a task much more rapidly completed in Captivate.  Leveraging the strengths of the two applications allowed us to create the module as quickly as possible.

2 comments:

  1. Stephen, this is really cool! I would better learn something about AS3 to help Captivate projects development.

    ReplyDelete
  2. For Captivate 5.5 system variables, the following code works from the root of the Flash file to advance to the next screen:

    MovieClip(this.parent.root).rdcmndNextSlide = 1;

    (this is an update to the parent.parent method that worked in Captivate 5)

    ReplyDelete