• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Javascript in captivate

Community Beginner ,
Feb 09, 2018 Feb 09, 2018

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

      }

Views

610

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Feb 12, 2018 Feb 12, 2018

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?

Votes

Translate

Translate
LEGEND ,
Feb 09, 2018 Feb 09, 2018

Copy link to clipboard

Copied

This is the Adobe Animate forum. You want the Captivate forum.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 09, 2018 Feb 09, 2018

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 09, 2018 Feb 09, 2018

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)

      }

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 09, 2018 Feb 09, 2018

Copy link to clipboard

Copied

Hi Colin, thanks will give it a go and let you know

Kind regards

Craig Sumner

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 12, 2018 Feb 12, 2018

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 12, 2018 Feb 12, 2018

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 11, 2018 Jun 11, 2018

Copy link to clipboard

Copied

LATEST

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();     

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines