As alluded to in a previous post, I’ve whipped up a simple JavaScript utility to help you control your Captivate SWFs using JavaScript. Give it a spin.

The biggest selling point for this utility is that it not only contains all of the built-in Captivate ‘variable’ functionality, but it also contains some extra functionality created by chaining some variables together. For instance, Captivate’s built-in rdcmndGotoSlide automatically pauses the SWF when it reaches the desired slide; to get around this limitation, I created gotoSlideAndPlay, which does exactly what you’d expect: jumps to the desired slide, then unpauses the SWF. gotoFrameAndPlay works the same way. There’s also muteWithCaptions, which mutes the SWF’s audio while toggling on captioning, and unmuteWithCaptions, which turns audio back on while disabling captioning.

Using pipwerks.captivate.control() also means you don’t need to know the full rdcmnd phrases and numerical values; they have been replaced with simpler, more Flash-like phrases that are easier to remember and use.

Here is a list of available commands:

  • pause (rdcmndPause)
  • resume (rdcmndResume)
  • next (rdcmndNextSlide)
  • previous (rdcmndPrevious)
  • rewindAndStop (rdcmndRewindAndStop)
  • rewindAndPlay (rdcmndRewindAndPlay)
  • info (rdcmndInfo)
  • showCaptions (rdcmndCC)
  • hideCaptions (rdcmndCC)
  • mute (rdcmndMute)
  • unmute (rdcmndMute)
  • hidePlaybar (rdcmndHidePlaybar)
  • muteWithCaptions (rdcmndMute & rdcmndCC)
  • unmuteWithCaptions (rdcmndMute & rdcmndCC)
  • gotoSlideAndStop (rdcmndGotoSlide)
  • gotoSlideAndPlay (rdcmndGotoSlide & rdcmndResume)
  • gotoFrameAndStop (rdcmndGotoFrame)
  • gotoFrameAndPlay (rdcmndPause & rdcmndGotoFrameAndResume)

The following commands do not currently work when using JavaScript:

  • exit (rdcmndExit)
  • showPlaybar (rdcmndHidePlaybar)

If I can figure out why, I’ll be sure to let you know.

Detailed instructions for the utility and a download link can be found here. The script has been compressed to minimize bandwidth consumption, and is only 1.8kb. It has also been vetted with Douglas Crockford’s jslint (prior to compression).

Legal disclaimer: As with most of my other utilities, this utility is provided free, as-is, with no guarantees or support.

I hope you enjoy it and find it useful.

Similar Posts

One Comment

  1. Hi,

    I’m using Captivate videos inside a Flash application.

    I’m trying to figure out how to have video1 open at the end automatically video2 in the same window video1 played. Hence, never leaving the Flash container it originally played from. Currently video1 is opening a new window leaving the flash application below.

    How can I do that?


Comments are closed.