Captivate 9 OnLoad Not Working
I cannot figure out why, but my On Enter event is not working as it should.
I have a captivate variable called "level", which is set to a default value of "0".
On every slide(level), I have an On Enter event (javascript).
The On Enter javascript uses this code (for level 1a):
window.cpAPIInterface.setVariableValue("level", "1a");
Issue:
Regardless of which level I complete (e.g. 1b, 2a, 2b, 3a, etc), the variable remains with a value of "1a" (the first level).
Note: On Enter should for each slide(level) set the "level" variable to its respective value (not 1a).
I have tried using the EventListener TWO ways in each slide(level)'s On Enter event, but all that did was always keep the variable set to the default "0".
Here is the code (for level 1a) WAY ONE:
var levelSetup = function(){
window.cpAPIInterface.setVariableValue("level", "1a");
}
window.addEventListener('moduleReadyEvent', levelSetup);
Here is the code (for level 1a) WAY TWO:
window.addEventListener('moduleReadyEvent', levelSetup); // I TRIED THIS HERE AND BELOW THE FUNCTION
function levelSetup() {
window.cpAPIInterface.setVariableValue("level", "2b");
}
