Is there an Adobe Captivate Javascript Reference? How can we get a complete list of JS functions and variables in CP 2019 with their specifications?
January 8, 2020
Is there an Adobe Captivate Javascript Reference? How can we get a complete list of JS functions and variables in CP 2019 with their specifications?
January 8, 2020

Hello guys…

I’ve been working with Captivate 2019 for a couple of months and trying to get the most out of it with Javascript. I think I’ve managed to do a few nice things with it. I’m kind of building a reusable framework within my simulators. One thing I’ve been struggling with is how poorly documented CP is… especially regarding the Javascript interface. There might be an official CP Javascript Reference that I have overlooked after browsing Adobe’s support and e-learning websites but, I think I’m giving up looking for it.

When I browse the forums for help, I frequently see how others use functions such as:
cp.clickHandler(item);
cp.animateItem(“18488”,20651,true,item_tag,4);
cp.runJavascript(cp.model.data.Button_1.oca);

I’ve been able to get a hold of them by playing around, testing and digging into them through the JS console, but it takes considerable time and effort. I find it sad that Adobe doesn’t responsibly provide thorough documentation of them. It looks like they don’t actually care about developers using Captivate.

I know there’s something at:
https://helpx.adobe.com/captivate/using/common-js-interface.html
and
https://helpx.adobe.com/captivate/using/captivate-variables-list.html
but it’s quite scarce and has no mention of these many useful JS functions that we see on the forums, and there might be many more. At this time I’m especially interested in cp.animateItem(). Do you know where to find its specifications by any chance?

Is there any (un)official complete guide or reference for CP’s JS functions and variables?

Thank you very much in advance!

All Comments
Sort by:  Most Recent
Mar 18, 2021
Mar 18, 2021

Does anyone know what would be the javascript command to use in advanced action to change the layout of  the Table of content from superimposed to extended.

I would like to have the TOC superimposed on the splash screen (index.html) and then show the rest of the project.

Like
(2)
(1)
Mar 18, 2021
Mar 18, 2021
>
softclic
's comment

I don’t think that will be possible, even by using Javascript. It would mean that the size of your course would be different since what you call ‘Splash screen’ would have the TOC in overlay, and the rest not which would have a completely different width. Think about a movie that starts with a smaller width and then suddenly has a larger width? How would that be experienced.

BTW, this has no link whatsoever with the original question in this thread.

Like
()
Mar 9, 2020
Mar 9, 2020

Hi – I’ve found using the command

cp.changeState(“OBJECT”,”STATE”);

or

cp.changeState(“OBJECT”,”Normal”);

to return to the default state extremely handy. Truly are these undocumented? As the original poster says, there must be a list of all of the cp.X commands available. I’m trying to find a way to change the colour of some text when clicked on. Yes I could use cp.hide() / cp.show() but I’m trying to steer away from relying on hidden objects and manipulating the DOM seeing as the output is now HTML5.

Any pointers would be ace!

 

 

Like
(1)
(1)
Mar 10, 2020
Mar 10, 2020
>
Claire_a_bradshaw
's comment

I rarely use JS and almost never use hidden objects since multi-state objects appeared. There are easier ways to return to Normal state even without JS.  Up to you to prefer programming of course, have done too much in my career and appreciate the comfort of advanced and shared actions. Much easier to debug.

Like
()
Jan 14, 2020
Jan 14, 2020

Perhaps this is too much on the beginner side but you can review this link as well.

https://elearning.adobe.com/2019/09/getting-started-javascript-adobe-captivate/

 

Like
(4)