Copy link to clipboard
Copied
Hi,
Is it possible to send a variable or activate a captivate action using javascript from a HTML5 animation ?
I try with something like this but don't works :
var vid = document.getElementById("myVideo");
vid.onended = function() {
window.cpAPIInterface.setVariableValue('cpCmndGotoFrame', 300);
};
For information, I really need to use a HTML5 Animation.
Thanks !
The animation is running in an iframe so you need to access the parent:
window.parent.window.cpAPIInterface.setVariableValue('cpCmndGotoFrame', 300);
to disable use:
window.parent.cp.disable("Button_66");
If you want to call an advanced action, the method I use is to create an invisible button with the advanced action attached to it. Then you can execute this Javascript:
window.parent.cp.runJavascript(cp.model.data[ "ObjectWithActionName" ].oca);
Copy link to clipboard
Copied
The animation is running in an iframe so you need to access the parent:
window.parent.window.cpAPIInterface.setVariableValue('cpCmndGotoFrame', 300);
Copy link to clipboard
Copied
Oh thank you so much, that's work perfectly !
And maybe can you say me how can I call advanced action with the same process ?
Copy link to clipboard
Copied
I try also to disabled a button but don't works 😞
window.parent.document.getElementById("Button_66").disabled = true;
Maybe idea ?
Copy link to clipboard
Copied
to disable use:
window.parent.cp.disable("Button_66");
If you want to call an advanced action, the method I use is to create an invisible button with the advanced action attached to it. Then you can execute this Javascript:
window.parent.cp.runJavascript(cp.model.data[ "ObjectWithActionName" ].oca);
Copy link to clipboard
Copied
Thanks again, all works first time !