Flash telling Lectora to move to the next page

dunnjo98
dunnjo98 Community Member Posts: 25
Ok, I have scoured the internet for the last 2 days trying desperately to figure out a solution for this issue I am having.  I found a Lectora file a while ago online (which I can't seem to locate anymore), but it had a flash file with a button and when that button was clicked (while sitting in Lectora), it would move to the next page of the Lectora file.  This was build using Lectora 9.

The button in Flash is coded like so:

done.addEventListener(MouseEvent.CLICK, nextLectoraPage);

function nextLectoraPage(e){
ExternalInterface.call("nextP");
}

Now I built a new Lectora file in 12 and I have an animated Flash file sitting on the page and at the end, I added a done button with the same code as above and the nextP action within Lectora.

It works on the file I downloaded from the internet, but not the file I built.

Can anyone help me figure out what I have done wrong?

Desperate.

Comments

  • t_johnb
    t_johnb [email protected] Community Member Posts: 295 ☆ Roadie ☆
    Every Lectora page has a JavaScript function on it to go to either the next or previous page. By just calling that function from Flash you can cause the course to navigate to the next page. The functions are:

    trivPrevPage();
    trivNextPage();

    I'm guessing the older title that has it working has an HTML extension on the page with a Javascript function called nextP() that calls trivNextPage(). You could add that HTML extension in, or just change the ActionScript to call trivNextPage().
  • klaatu
    klaatu Community Member Posts: 988
    Can you upload your .fla or .fxg?
  • dunnjo98
    dunnjo98 Community Member Posts: 25
    John, I knew it would be something so simple.  Thanks for this, it really helped me out.  I give you stars and thumbs up.  Really appreciate you taking the time to do this.

    Sorry Darrel, it is work related, so I can't post it.  I guess I could have created a fake one, but I can tell you John offered the working solution.

     

     
  • klaatu
    klaatu Community Member Posts: 988
    That's why I had given him a thumbs up. I was going to update it and put it back up for you. Np.
  • dunnjo98
    dunnjo98 Community Member Posts: 25
    So, ok.  I have begun to play with Flash Canvas in Flash professional CC.  Not sure any of you have started to play with this, but I am slowly working my way through rebuilding a course and the animation.  I have the button working above, but now that I am outputting an html5 and js document.  Any advice on acessing trivNextPage() from within the js file?

    I am googling, but, as per usual I am lacking the right language I would like to get successful answers.

    I hope this makes sense.

    Basically before in AS3 I did this:

    function nextLectoraPage(e){
    ExternalInterface.call("trivNextPage()");
    }

    but if you are working in canvas, it needs to be js.

     

    Thanks all.
  • klaatu
    klaatu Community Member Posts: 988
    Dunnjo98, I am assuming you are working in Animate CC and that you have built a button or something to click on to advance to the next page. I think you'll find this easier than AS3.

    On the stage, select the item that will be click on to advance to the next page in Lectora. Make sure in the timeline you are on the frame you want to add the script. Press f9 to open the Actions panel.

    (see image below)
    1. Select the <> to open the snippets.
    2. Expand the HTML5 canvas snippets then expand Event Handlers. Double click Mouse click Event to add the snippet to the Action pane.
    3. Remove the placeholder alert code and replace it with parent.trivNextPage();

    That's it. Publish and it's ready to be imported into Lectora using the webwidget local-based files. As a side note, I usually select include JS in the HTML file in Animates publish settings (advanced tab) so I do not have to also include a separate js file. Works either way.

    https://i.imgsafe.org/a2de310e6f.jpg
  • dunnjo98
    dunnjo98 Community Member Posts: 25
    Perfect and clear, thanks Darrel.  I was missing the parent piece.  Huge help.