Copy link to clipboard
Copied
Hi all
I am using this code
var box = $('#restart_loop')[0]; cp.clickHandler(box);
on an "on Enter" action for a slide in my captivate, it initiates an advanced action on a hidden button on the slide.
this works perfectly, but I want to add a .oam object that I have built in adobe animate cc with a button that can also initiate the same function
i would normally use:
this.Reset.addEventListener("mousedown", fl_MouseClickHandler.bind(this));
function fl_MouseClickHandler()
{
window.parent.cpAPIInterface
)
to control captivate from an animate object. so I tried:
this.Reset.addEventListener("mousedown", fl_MouseClickHandler.bind(this));
function fl_MouseClickHandler()
{
var box = $('#restart_loop')[0]; cp.clickHandler(box);
}
this did nothing so what I am wondering is how would I combine:
var box = $('#restart_loop')[0]; cp.clickHandler(box);
with:
this.Reset.addEventListener("mousedown", fl_MouseClickHandler.bind(this));
function fl_MouseClickHandler()
{
window.parent.cpAPIInterface
}
You could look in the browser's developer tools to see if there are any errors that would give a clue about what's going wrong.
Would you be able to post the page somewhere we can try it?
Copy link to clipboard
Copied
This is the Adobe Animate forum. You want the Captivate forum.
Copy link to clipboard
Copied
Well I'm asking how I make my javascript code in Adobe animate access this particular var in captivate, most of the interaction stuff that I use in animate cc to control adobe captivate variables and bits I find in this forum not the adobe captivate forum, mainly because the interactions I create are not standard out of the box stuff that captivate does, I only really use captivate ad a wrapper for animate.oam files to produce unique e-learning interactions.
Copy link to clipboard
Copied
I think here is an ok place to ask this, seeing as the solution goes into your Animate code.
I don't really know JQuery at all, but it also seems to have a .parent() function. Would this work?:
with:
this.Reset.addEventListener("mousedown", fl_MouseClickHandler.bind(this));
function fl_MouseClickHandler()
{
var box = $(window.parent().'#restart_loop')[0];
window.parent.cpAPIInterface(box)
}
Copy link to clipboard
Copied
Hi Colin, thanks will give it a go and let you know
Kind regards
Craig Sumner
Copy link to clipboard
Copied
Hi Colin
that just broke the oam. the preview and the oam both could not display the button after I applied the code in animate cc,
I tried a few variations such as window.parent.cp but none of it had any effect
Copy link to clipboard
Copied
You could look in the browser's developer tools to see if there are any errors that would give a clue about what's going wrong.
Would you be able to post the page somewhere we can try it?
Copy link to clipboard
Copied
Hi Colin
I have been reading the post and also other similar ones but I cannot find the way to control Captivate from the Animate oam movie.
What would be the simplest command that I can attach to a button in Animate project that would be exported to oam.
In Captivate I would use this JS line to move to the next slide for instance.
window.cpAPIInterface.next();
How can I attach it to a button in Animate. I try this for instance but without success...
this.Reset.addEventListener("mousedown", fl_MouseClickHandler.bind(this));
function fl_MouseClickHandler()
{
window.cpAPIInterface.next();
}