Copy link to clipboard
Copied
Hello,
I am attempting to user Captivate vaiables to build a dynamic URL, however, I am having no luck locating them in the DOM. I have tried just alerting variables specified in this link List of variables in Adobe Captivate.
I have tried top, parent, and cp to locate the variables and am getting undefined for all.
When calling these variables in JavaScript, how do they have to be accessed?
Thanks,
Matt
Copy link to clipboard
Copied
What code are you using to alert these variables?
Where are you executing the code?
What version of Captivate and which output, SWF or HTML5 or both?
Copy link to clipboard
Copied
Currently just using a button to alert them with the action set to execute javascript.
so, for instance alert(cpQuizInfoStudentID);
Using Captivate 9. Tried both outputs.
Copy link to clipboard
Copied
If you are just using HTML5 you can get them in the window object:
window.cpQuizInfoStudentID
If you are using both SWF and HTML5 or just SWF you'll need to use the Common JS Interface:
window.cpAPIInterface.getVariableValue('cpQuizInfoStudentID')
You can read about the interface here.
Learn about the Common JavaScript interface for Adobe Captivate