Skip to main content
Participant
October 17, 2016
Question

Use Captivate Variables in dynamic URL

  • October 17, 2016
  • 1 reply
  • 509 views

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

This topic has been closed for replies.

1 reply

TLCMediaDesign
Inspiring
October 17, 2016

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?

BikeMattAuthor
Participant
October 17, 2016

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.

TLCMediaDesign
Inspiring
October 17, 2016

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