HTML5 Canvas access.

tbrodowski6367
tbrodowski6367 Community Member Posts: 31
Hello,

I have a simple Adobe Animate animation with a stop on the first and last frame of animation. I've added it to Lectora via Web Window and added a button to the stage.  I would like to start the animation inside the the Web Window when I press the Lectora button.  Is that possible?  Im attaching the Lectora file for reference.

Thank you,

Tom.

Comments

  • timk
    timk Community Member Posts: 1,176 ☆ Superstar ☆
    It's possible:

    document.getElementById("webwidget117iframe").contentWindow.exportRoot.play();

    "webwidget117" should be replaced with the html name of the Web Window.
  • tbrodowski6367
    tbrodowski6367 Community Member Posts: 31
    Thank you Tim, you've been wonderfully helpful!  Works like a charm.
  • tbrodowski6367
    tbrodowski6367 Community Member Posts: 31
    Hello Tim,

    I do have have a follow up question.  How would that code change if I published to seamless play? I think that's going up another level.

    Would it be parent.document.getElementById("webwidget117iframe").contentWindow.exportRoot.play();

    Thank you.
  • timk
    timk Community Member Posts: 1,176 ☆ Superstar ☆
    Yes, that should work. Even better would be:

    getDisplayDocument().getElementById("webwidget117iframe").contentWindow.exportRoot.play();

    Then it works both ways, with and without seamless play.
  • tbrodowski6367
    tbrodowski6367 Community Member Posts: 31
    Thanks Tim, you're the best.
Sign In or Register to comment.

So You Wanna Be An eLearning ROCKSTAR?

We're all fans of eLearning here! Want to become an eLearning ROCKSTAR? Just click on one of the buttons below to start your rocking journey!