Guide to Using JavaScript in Adobe Captivate

It's easier than you might think to use JavaScript in combination with Adobe Captivate content, and the results can be surprisingly powerful and effective. This section of our website contains tutorials explaining how to enhance your e-learning courses using the JavaScript programming language.  It assumes you have at least a basic understanding of programming principles.  But you do not need to have advanced programming experience to get started with JavaScript.

If you have a question about using JavaScript with Flash-based Captivate e-learning, or have an idea for another tutorial on this topic, send us a message via our Contact form.

Comments

Trying to use java to create a nested function. But not sure how.

Rod Ward's picture

It sounds like you might be a bit of a beginner with JavaScript. If so, I suggest you go here: http://captivatedev.com/2014/01/02/javascript-video-series-adobe-captivate-7/
Jim Leichliter's course is now the best resource on the web for learning JavaScript that is used with Adobe Captivate.
 
 

It's a shame, but Jim is no longer selling that course or the cp8 update. There is so much conflicting information on how JavaScript communication should be done with SCORM for example, in each subsequent version it seems to change, and it's enough to make a ISD with only basic scripting/AS2 experience pull what little is left of his aging hair out. I have a pretty simple piece of content, a video on a single slide, that's it. I imported with the share across slides option, so it made the slide frames match the total of the video frames. But, it's a SCORM 1.2 LMS that plays content in a windowed frameset, as each sco from the outline is called, this frameset is replaced with the content in that main window, and when an LMSFinish() is called, the SCO closes, and the previous scorm outline/tree allows user to pick the next SCO to be ran. But, it's not working that way - Captivate is closing the entire window, plus there are so many differing opinions/examples of how to talk to the SCORM depending on cp version, eg. v9 are we supposed to use the JS Interface to talk to SCORM, can anyone give a decent working example of if the user watched the whole video it sets lesson as "completed" yet if they exit before entire movie is viewed it sets status to "incomplete", sets exit to resume, and somehow bookmarks the last frame the video was on, not slide, since its on a single slide, if the exit is resume and there is bookmark data, otherwise set exit normally and clear the suspend data. I have tried so many iterations and approaches, and still can't get it to set the values and fire off a simple LMSfinish (). It's really starting to frustrate the hell out of me, and these videos are needed training for our USAF clients. I'm normally the LMS Administrator, but have to jump in and do graphics, or whatever needed, for at least those working within the clients facility we don't have a true development pipeline, just sustain/maintain. Any help, suggestions or working examples to use for SCORM 1.2 in Cap9 would be sincerely appreciated. BTW Rod, your advanced actions and troubleshooting for cap 8 books are Awesome!! keep up the great work- I wish I had such an awesome and easy to understand go-to guide for dealing with Both versions of SCORM and the xAPI together in one reference - I'd be throwing down cash so fast for that, my wallet would be smoking....LOL.

IF YOU LIKE WHAT YOU'VE READ ABOVE, THERE'S PLENTY MORE!

Join more than 2500 other Adobe Captivate users just like yourself and receive regular troubleshooting tips, illustrated tutorials, technical information, and creative solutions to real-world e-learning development issues. (See an example here.) Click the button below to join our community.  It's completely FREE!