Skip to main content
craigs8411935
Participating Frequently
February 9, 2018
Question

javascript command from animate cc

  • February 9, 2018
  • 1 reply
  • 392 views

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

      }

This topic has been closed for replies.

1 reply

Participant
February 23, 2018

Change

this.Reset.addEventListener("mousedown", fl_MouseClickHandler.bind(this));

     function fl_MouseClickHandler()

     {

    WINDOW.parent.cpAPIInterface

      }

to:

this.Reset.addEventListener("mousedown", fl_MouseClickHandler.bind(this));

     function fl_MouseClickHandler()

     {

    parent.window.cpAPIInterface();

      }

I hope this helps.