Runtime event communication between Animate and Captivate

Community Beginner ,
Nov 11, 2020

Copy link to clipboard

Copied

Is there documentation I'm missing on this subject? 


For example a button in the Animate animation that tells the Captivate slide to continue? I don't think I can callback from within the iframe.

 

Or a button in Captivate at the end of the animation? I tried but it is hidden by the animation when I publish, even though it is on a higher layer. The only workaround I've found is to make the animation background transparent but this is obviously not ideal. And when I try to set the z-index of the animation (.cp-WebObject) to -1 it is covered in white by the button layer.

Views

91

Likes

Translate

Translate

Report

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

1 Correct Answer

Adobe Community Professional , Nov 12, 2020
TLCMediaDesign Adobe Community Professional , Nov 12, 2020
Since the web object is in an iFrame, to access CP you need to preface any cp commands with window.parent in JavaScript. Here is documentation on JS in Captivate.   https://helpx.adobe.com/captivate/using/common-js-interface.html   To honor the stacking or you need to change UseWidget7 = 0 to UseWidget7 = 1 in the AdobeCaptivate.ini file located here:   C:\Program Files\Adobe\Adobe Captivate 2019 x64\

Likes

Translate

Translate
Jump to answer Jump to answer
Most Valuable Participant ,
Nov 12, 2020

Copy link to clipboard

Copied

You will need to program this with JS. There is no easy collaboration between Animate animations and Captivate like was possible with SWF animations. 

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Nov 12, 2020

Copy link to clipboard

Copied

Since the web object is in an iFrame, to access CP you need to preface any cp commands with window.parent in JavaScript. Here is documentation on JS in Captivate.

 

https://helpx.adobe.com/captivate/using/common-js-interface.html

 

To honor the stacking or you need to change UseWidget7 = 0 to UseWidget7 = 1 in the AdobeCaptivate.ini file located here:

 

C:\Program Files\Adobe\Adobe Captivate 2019 x64\

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Community Beginner ,
Nov 19, 2020

Copy link to clipboard

Copied

Great, I got it working, thanks. Documentation doesn't mention that you need to add "parent" in your Animate code, for example

window.parent.cpAPIInterface.pause();

rather than 

window.cpAPIInterface.pause();

 

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Nov 19, 2020

Copy link to clipboard

Copied

That's because they are not mentioning anything about code that is runnning in an iFrame.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Community Beginner ,
Nov 19, 2020

Copy link to clipboard

Copied

Oh, right. That's specific to the Animate > Captivate workflow. Also, for anyone else trying this, the code above will work in a Captivate html import but crash in Animate test movie because there's no iframe, so you can use the following to work in both scenarios.

if (window.parent.cpAPIInterface){
	window.parent.cpAPIInterface.pause();
}

 

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Nov 19, 2020

Copy link to clipboard

Copied

I have not enough ablilty about codes. Please contact and help me. I am in serious trouble. ozgur.uyar@gsi.com.tr

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Contributor ,
Nov 19, 2020

Copy link to clipboard

Copied

This is the sort of thing that the newly released CpMate plugin is supposed to assist with.

For example, Captivate has the system variable cpCmndPause which allows you to pause the movie by assigning it with 1.

 

With CpMate installed, you can use it's javascript api to read/write Captivate variables such as cpCmndPause

X.captivate.variables.cpCmndPause = 1

 

CpMate and CpExtra go hand in hand. With CpExtra installed you can create the xcmndHide and xcmndShow variable which can be used to hide and show objects in Captivate.

Say you had a button in Captivate called Button_1 which you want to show at a certain point in your animation. You could do so from Adobe Animate with the following Javascript:

X.captivate.variables.xcmndShow = "Button_1";

 

From your question it seems you may want Captivate to influence what kind of animation will play. This is possible using CpMate's bound movie clips.

Likes

Translate

Translate

Report

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