Copy link to clipboard
Copied
Hi,
I am trying to make some simple variable changer html files that I can drag and drop into captivate.
I want them to call to captivates cpInfo and cpCmnd Systems variables. Iknow the scripts work as I can get them to work in captivates own script window.
I just need them to operate from a web object.
My html code is this.
//////////////////////////////////////////////////
<html>
<head>
<script>
window.onload = function() {
window.cpAPIInterface.next();
};
</script>
</head>
<body>
</body>
</html>
/////////////////////////////////////////////////////
I thought this would work but nothing happens.
Any help would be appreciated.
Cheers
Luke
OK I cracked it!
It helps for captivate to have a receiver script. Something like this:
function Tell_me(string)
{
window.cpAPIInterface.setVariableValue("Questions",string);
}
and the html file has a sender script. Like this:
<html>
<head>
<script type="text/javascript">
parent.Tell_me('The quick brown fox');
</script>
</head>
<body>
</body>
</html>
The data gets sent from one to the other. I think I can do heaps with this from here on.
Copy link to clipboard
Copied
Hey I figured this out on my own.
//////////////////////////////////////////////////
<html>
<head>
<script>
window.onload = window.cpAPIInterface.next();
</script>
</head>
<body>
</body>
</html>
/////////////////////////////////////////////////////
Copy link to clipboard
Copied
Oops I have a new problem now....
Cptv8 is loading from a cached version of the file I loaded. Its an older html file not the one I want to load.
Is there no end to how rubbish this software is?
Copy link to clipboard
Copied
And again oops the above code is incorrect. It was working fine because the code was still sitting in the captivate script window.
I still need help with this.
Copy link to clipboard
Copied
OK I cracked it!
It helps for captivate to have a receiver script. Something like this:
function Tell_me(string)
{
window.cpAPIInterface.setVariableValue("Questions",string);
}
and the html file has a sender script. Like this:
<html>
<head>
<script type="text/javascript">
parent.Tell_me('The quick brown fox');
</script>
</head>
<body>
</body>
</html>
The data gets sent from one to the other. I think I can do heaps with this from here on.
Copy link to clipboard
Copied
Totally off topic, thanks a lot for this workaround but do you mind if I move this thread to the subspace 'Advanced'? You don't want to frighten newbies
Copy link to clipboard
Copied
That's fine.