Reverse engineering Captivate for HTML5 widgets

Adobe Captivate is pretty horrible, especially the HTML5 output. I feel like I’m banging my head against a wall every time I use it. The HTML5 output is riddled with bugs and most of the features simply don’t work. If there is one upside to the HTML5 publishing though (and there aren’t many), it’s the ability to access almost anything in the Captivate movie due to the openness of JavaScript and work around its frustrations. I thought I would document a couple issues I faced which could potentially help someone else out. If you’re trying to figure out how to create a HTML5 widget then see my post on Creating HTML5 widgets for Adobe Captivate 6/7.

Problem 1: Create a custom slide index widget

This is pretty much impossible in the Flash publish. I needed a widget that would automatically get all the slide labels and generate an index. After a bit of digging thanks to Chrome’s dev tools, I discovered that most slide information can be found in the ‘toc’ global object on main Captivate window.

Below is a snippet of code that can be used in the HTML5 widget to get all slide names:

var mainWindow = window.parent; // get captivate main window, widgets are loaded into an iframe

// get list of slides
var slides = mainWindow.toc.mainMovie.stage.slides;

// get slide labels
var i = 0, lgt = slides.length;
for (i; i < lgt; ++i){
  // log all slide labels to the console, you could add them to your custom menu
  console.log( mainWindow.toc.movieProperties[slides[i]].lb );
}

Problem 2: Setting variables doesn’t work properly

Another bug I found in Captivate HTML5 widgets was sometimes setting a variable on the varHandle object doesn’t trigger a change in the movie, such as the cpCmndGotoSlide variable, which tells the movie to go to a particular slide. I found the following snippet to work more reliably:

// use the main movie's executeAction to set the variable
mainWindow.toc.mainMovie.executeAction("cpCmndGotoSlide = 2"]); // go to slide 3

I hope someone else will find this useful.

Inspiring Inspiration #13

A collection of cool video, motion graphics and interface design, mostly if not all from Vimeo…

READ MORE

Setting up BSQSimulator with CCV

I decided to compile the links and instructions for setting up BSQSimulator for my own future reference and to hopefully help others out. The directions are buried in the NUIGroup forums somewhere and can sometimes be difficult to find, with different versions requiring various MS Surface files.

The files you’ll need:

BSQSimulator2 (beta) direct download
http://nuigroup.com/?ACT=28&fid=18&aid=7724_evLAPcRQso47Q2MgySzN

BSQSimulator driver
https://code.google.com/p/bsqsimulator/downloads/detail?name=Driver_Final.rar&can=2&q=

Surface Runtime
http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=26716

 

Setup in this order:

  1. Install the Surface Runtime
  2. Install the driver for your platform (x86 or x64)
  3. Run BSQSimulator2 as administrator

That’s it! You should be good to go now.