Skip to main content
Inspiring
August 21, 2017
Answered

Did cpAPIInterface change in CP 2017?

  • August 21, 2017
  • 2 replies
  • 910 views

I can't get my simple scripts from CP9 to work in CP10, but can't find documentation on what, if anything, has changed. I'm just doing a simple cookie write/read using window.localStorage.setItem/getItem with window.cpAPIInterface.setVariableValue. I've used in multiple projects without fail prior to using new and upgraded projects in Captivate 2017. Right now the script fires on entering the very first slide and hangs the project immediately; hiding those slides lets the project play as expected. Any ideas would be appreciated...

Thanks!

This topic has been closed for replies.
Correct answer kevinc13836104

By way of closing the loop in case anyone else stumbles upon this... After a lot of trial & error I discovered that the Javascript was not the culprit after all. It turns out that in Captivate 2017, unlike CP9, you can't have more than three buttons that are set to display for the rest of the project; we had nine such buttons. It also is seemingly irrelevant over how many slides they're distributed—three on one slide, and one on another will still break the project. See this thread for more information: More than three smart shape buttons on master slide?

(And of course thanks to Jim for taking a look at this too!)

2 replies

Legend
August 21, 2017

Or you can post your code.  Whatever works for you.

Inspiring
August 21, 2017

Set the cookie:

localStorage.setItem("knight_choice", window.cpAPIInterface.getVariableValue("knight_choice"));

Retrieve the cookie:

var sName = window.localStorage.getItem("knight_choice");

if(sName){

    window.cpAPIInterface.setVariableValue("retrievedCookie", sName);

}

else {

    window.cpAPIInterface.setVariableValue("retrievedCookie","red");

}

kevinc13836104AuthorCorrect answer
Inspiring
August 24, 2017

By way of closing the loop in case anyone else stumbles upon this... After a lot of trial & error I discovered that the Javascript was not the culprit after all. It turns out that in Captivate 2017, unlike CP9, you can't have more than three buttons that are set to display for the rest of the project; we had nine such buttons. It also is seemingly irrelevant over how many slides they're distributed—three on one slide, and one on another will still break the project. See this thread for more information: More than three smart shape buttons on master slide?

(And of course thanks to Jim for taking a look at this too!)

Legend
August 21, 2017

Hi Kevinc,

I'd be happy to look at your .cptx project if you want to send it over.  Jim AT Up Skill Ya dot com

Best,

Jim Leichliter