Skip to main content
patrickz95336299
Participant
February 4, 2016
Répondu

HTML5/JavaScript (WebObject) Communication with Captivate 9

Hello

Me and my company i work for, trying now for 2 days how that can work... I hope someone can help me or we can do it together

My goal is to have an imported-zipped HTML5 file, with an animation created in Adobe Flash, that can e.g. jump to a next slide. (To keep it simple for now )

What i did so far:

1. I created a HTML5 Canvas in Adobe Flash CC. There i created the animation i want and published it into a HTML5 folder/project.

2. I zipped it and imported it into Captivate, it works pretty fine.

3. I can click on it with a simple EventListener (which i added in Flash) via this.myMovieClip.addEventListener("click", fl_MouseClickHandler.bind(this)); in Captivate. It works nice!


4. Now i wanted to add the possibilty to Click on it and go to next slide through the JavaScript that is created when i publish the Flash file. Since HTML5 and ActionScript3 hasn't the same syntax i am wondering how its is possible...

In AS3 i was able to it through (to access the Captivate:


var myRoot:MovieClip = MovieClip(root);

var mainmov:MovieClip = MovieClip(myRoot.parent.root);


And thats pretty much the problem... I don't know how to let the JavaScript communicate with Captivate when i import the HTML5 Files...

I tried it through "window. ...",  "this.parent. ..." and some other ideas that didn't work.

I have a basic understand of JavaScript, but can't figure it out by myself...

Thx for help. (Or ideas i can try)!!!

Ce sujet a été fermé aux réponses.
Meilleure réponse par TLCMediaDesign

window.parent.window.cpAPIInterface.next();

1 commentaire

TLCMediaDesign
Inspiring
February 4, 2016

window.parent.window.cpAPIInterface.next();

patrickz95336299
Participant
February 5, 2016

Yeah! That worked! So close ... Thanks!

And am i right to say, that i can access via "window.parent.window" everything i want in Captivate?

By the way, do you have any recommendations for learning things like that? (I study the w3school site, i think theres pretty much all basics...)

Greetings.

TLCMediaDesign
Inspiring
February 5, 2016

Most everything is in the window object.

w3s is a great place for examples and learning the DOM and JavaScript basics. Most of my experience came from AS2, AS3, Authorware and Visual Basic. JavaScript and ActionScript  are both based on the ECMA standard.

adripofjavascript.com is a good resource also.