Skip to main content
sharonhuston23
Known Participant
Jul 10, 2019 3:52 PM UTC
Answered

Need Basic Help with moduleReadyEvent

I can't get the moduleReadyEvent to fire. I know I'm doing something stupid, but I've been fussing with this for hours now and could really use some help.

I'm on Captivate 11.0.1.266, publishing as HTML5 only.

This code is on my first slide, using an On Enter action.

The time shows in the console (10:34 am), so I know the code works.  The success message never appears.

window.addEventListener("moduleReadyEvent", function evtFunc(evt)

{

console.log("success");

});

console.log("10:34 am");

What am I missing?

    This topic is closed to new replies. Start a new post to keep the conversation going.
    Stagprime2687219
    Stagprime2687219Correct answer
    Legend
    Jul 10, 2019 4:51 PM UTC

    To address the moduleReadyEvent... try this...

    window.addEventListener("moduleReadyEvent", function(evt)

    {

        var interfaceObj = evt.Data;

        var eventEmitterObj = interfaceObj.getEventEmitter();

    },

    console.log("success")

    );

    4 replies

    Stagprime2687219
    Stagprime2687219Correct answer
    Legend
    Jul 10, 2019 4:51 PM UTC

    To address the moduleReadyEvent... try this...

    window.addEventListener("moduleReadyEvent", function(evt)

    {

        var interfaceObj = evt.Data;

        var eventEmitterObj = interfaceObj.getEventEmitter();

    },

    console.log("success")

    );

    Translate
    sharonhuston23
    Known Participant
    Jul 10, 2019 5:09 PM UTC

    Brilliant, this totally worked.  Thank you!!

    Translate
    Inspiring
    Jul 15, 2019 12:33 PM UTC

    Strange to me that you got it to work by running that code in an 'OnEnter' action on the first slide.

    My understanding was that it has to be ran from index.html or some external js file as the moduleReadyEvent fires long before any OnEnter action gets triggered?!

    Maybe some js guru can chime in and explain?

    Translate
    Stagprime2687219
    Legend
    Jul 10, 2019 4:17 PM UTC

    How about trying this method...?

    $(document).ready(function() {
    console.log("success");
    });

    Translate