Executing advanced action using Javascript in Animate CC
I'm trying to execute an advanced action in Captivate when a button created in Animate CC is click.
I've been following this tutorial: How to Trigger Captivate Advanced Actions with Javascript | eLearning
I've created a clickbox called "Menu_btn" which on click executes an advanced action.
My code in Animate CC is:
this.menu_mc.addEventListener("click", fl_MouseClickHandler.bind(this));
function fl_MouseClickHandler()
{
this.menu_mc.gotoAndPlay('click');
window.parent.cp.clickHandler(Menu_btn);
}
The "window.parent.cp.clickHandler(Menu_btn);" should execute the advanced action as if the "Menu_btn" clickbox was clicked, but nothing happens. If I create another button in captivate with the execute JavaScript code "cp.clickHandler(Menu_btn);" it works fine, so I'm not sure why it isn't working in Animate CC. I've replaced the "window.parent.cp.clickHandler(Menu_btn);" with "window.parent.cp.hide("SmartShape_666");" just to check the function was firing and that worked fine.
Has anyone had any look getting the cp.clickHandler() function to work outside of Captivate?
