Explore the community Forums Lectora Lectora Questions & Answers Flash telling Lectora to move to the next page

Tagged: ,

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #323160 Score: 0
    Profile photo of dunnjo98
    dunnjo98
    Member
    beginner
    intermediate
    friend finder
    curious george
    wise owl
    contributor
    advanced
    Group Member
    picture perfect
    @dunnjo98

    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.

    #323170 Score: 3
    Profile photo of John Blackmon
    John Blackmon
    Member
    beginner
    intermediate
    contributor
    friend finder
    advanced
    junior moderator
    wise owl
    LUC16
    LUC16 Attendee
    verified member
    28 pts
    @johnb

    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().

    This post has received 3 votes up.
    #323171 Score: 0
    Profile photo of Darrel Somoza
    Darrel Somoza
    Member
    contributor
    friend finder
    beginner
    intermediate
    junior moderator
    advanced
    wise owl
    curious george
    profile
    194 pts
    @Klaatu

    Can you upload your .fla or .fxg?

    • This reply was modified 2 years, 7 months ago by Profile photo of Darrel Somoza Darrel Somoza. Reason: typo - missing space
    #323228 Score: 0
    Profile photo of dunnjo98
    dunnjo98
    Member
    beginner
    intermediate
    friend finder
    curious george
    wise owl
    contributor
    advanced
    Group Member
    picture perfect
    @dunnjo98

    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.

     

     

    #323232 Score: 0
    Profile photo of Darrel Somoza
    Darrel Somoza
    Member
    contributor
    friend finder
    beginner
    intermediate
    junior moderator
    advanced
    wise owl
    curious george
    profile
    194 pts
    @Klaatu

    That’s why I had given him a thumbs up. I was going to update it and put it back up for you. Np.

    #330220 Score: 0
    Profile photo of dunnjo98
    dunnjo98
    Member
    beginner
    intermediate
    friend finder
    curious george
    wise owl
    contributor
    advanced
    Group Member
    picture perfect
    @dunnjo98

    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.

    #330300 Score: 1
    Profile photo of Darrel Somoza
    Darrel Somoza
    Member
    contributor
    friend finder
    beginner
    intermediate
    junior moderator
    advanced
    wise owl
    curious george
    profile
    194 pts
    @Klaatu

    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

    This post has received 1 vote up.
    #330688 Score: 0
    Profile photo of dunnjo98
    dunnjo98
    Member
    beginner
    intermediate
    friend finder
    curious george
    wise owl
    contributor
    advanced
    Group Member
    picture perfect
    @dunnjo98

    Perfect and clear, thanks Darrel.  I was missing the parent piece.  Huge help.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.