I`m wondering if there is a way to do navigation stuff in Storyline using JavaScript codes and not "Jump to" triggers. I particular I`m interested in getting the current slide reference to save into some var to be able to refer back in future.
Did you ever get anyplace with this, Amir? I find some references to player.currentSlide() in the (heavily obfuscated) JavaScript but I have not yet been able to get any results with it from withing Articulate yet.
An interesting challenge! We're looking into the JS to find an easy way to output individual quizzing answers; we've wanted also to save a variable holding the current slide position, but also to jump to a specific slide on reload. if we come up with anything we will post.
Hi Guys, Yes and no. We did manage to get both of these functions running but the issue is that it will only work on the HTML5 version and not the flash version unfortunately, meaning you loose support for legacy browsers, Also as we know there is currently no way to disable flash output that mean's you'll have to manually make html5 version as the default once you've published the course. I've got no code at the moment (weekend) to share but am happy to do so once back at work so let me know if that helps but the key is what Brad has already pointed out, if you use Chrome to inspect the player object in HTML5 version of a published project it will expose all sorts of very useful methods that it holds and they all work like a piece of cake with javascript triggers inside Articulate. I guess it's time we devs make it loud and clear that while we respect the intuitive design, ease of doing most common tasks and the like in Articulate there is no way they can cover all the scenarios and it's time for them to expose APIs for deeper manipulations of projects.
I agree Amir - Storyline is a great tool for rapid development of some pretty nifty e-learning, but when you try to poke even remotely under the hood it gets fiddly or impossible. You can't even get the number of slides in a scene, even though this information is on the home screen of Storyline, in the bottom left corner. Let's hope that the SDK, API and/or indeed update 4, whenever they might be released, makes things easier.
Hi Kevin! This thread is a bit dated, but you are welcome to utilize the 'Contact Me' option on Amir's profile in case the user is no longer subscribed to this thread.
I, too, want to change slides using JavaScript instead of using the "Jump To" triggers. How do I refer to slides--what are they named? Is there a function I should use? I've tried looking in the JavaScript of the published output but can't find anything (that I recognize as being) for navigation to base my code on. I am with Jim about being frustrated when trying to do anything manually in Storyline. I miss Flash. So much.
A way I found around this is to have a trigger on each slide that writes a unique identifier to a Storyline variable. You can then access this variable externally to manipulate it or watch it within Storyline.
Without knowing the specifics of your issue you could adopt the approach above with a watch trigger on the master slide to watch for a change in that variable then have a conditional statement to carry out your action depending on the value.
I hope this helps get you on the right path.
Ideally if we had access to the variables themselves we could avoid allot of manual trigger setup.
I'm creating an animated menu on the Master Slide using two layers--a "ShowMenu" layer for the opening animation and a "HideMenu" layer for the closing animation. Opening and closing the menu are beautiful things to behold. However, clicking on a menu item jumps to the desired slide--even if I put a trigger to show "HideMenu" before the "Jump to" trigger. It just happens too fast and looks like it's slamming shut--sloppy.
What I want is this:
When the user clicks a menu item it triggers two things: Assigns a value ("1" for slide one, etc.) to a variable (let's call it "slideClicked") then shows the "HideMenu" layer.
At the end of the "HideMenu" layer's time line (just .75 seconds--long enough to show the animation) a trigger jumps to a slide based on the slideClicked variable.
I'm stuck because I don't know how to tell it to "jump to" a slide in JavaScript and I don't know how to refer to the slide so that the Player understands.
If I could use Condition in a trigger to say "If the variable is 1 jump to slide 1" else "if the variable is 2 jump to slide 2" I'd be super happy but it doesn't seem like Triggers can handle anything like that.
I need revert back 5 seconds on the timeline whenever "" << Go Back 5 seconds" button clicked. I am very interested in seeing how you handle getting/setting and manipulating currentSlide information? Can you share your code/experiences with me?
11 Replies
Did you ever get anyplace with this, Amir? I find some references to player.currentSlide() in the (heavily obfuscated) JavaScript but I have not yet been able to get any results with it from withing Articulate yet.
An interesting challenge! We're looking into the JS to find an easy way to output individual quizzing answers; we've wanted also to save a variable holding the current slide position, but also to jump to a specific slide on reload. if we come up with anything we will post.
John.a.
Hi Guys, Yes and no. We did manage to get both of these functions running but the issue is that it will only work on the HTML5 version and not the flash version unfortunately, meaning you loose support for legacy browsers, Also as we know there is currently no way to disable flash output that mean's you'll have to manually make html5 version as the default once you've published the course. I've got no code at the moment (weekend) to share but am happy to do so once back at work so let me know if that helps but the key is what Brad has already pointed out, if you use Chrome to inspect the player object in HTML5 version of a published project it will expose all sorts of very useful methods that it holds and they all work like a piece of cake with javascript triggers inside Articulate. I guess it's time we devs make it loud and clear that while we respect the intuitive design, ease of doing most common tasks and the like in Articulate there is no way they can cover all the scenarios and it's time for them to expose APIs for deeper manipulations of projects.
I agree Amir - Storyline is a great tool for rapid development of some pretty nifty e-learning, but when you try to poke even remotely under the hood it gets fiddly or impossible. You can't even get the number of slides in a scene, even though this information is on the home screen of Storyline, in the bottom left corner. Let's hope that the SDK, API and/or indeed update 4, whenever they might be released, makes things easier.
Cheers,
Jim
Hi Amir,
I would be interested in seeing how you handled this for the HTML5 version. If you are still willing to share.
Thanks
Kevin
Hi Kevin! This thread is a bit dated, but you are welcome to utilize the 'Contact Me' option on Amir's profile in case the user is no longer subscribed to this thread.
I, too, want to change slides using JavaScript instead of using the "Jump To" triggers. How do I refer to slides--what are they named? Is there a function I should use? I've tried looking in the JavaScript of the published output but can't find anything (that I recognize as being) for navigation to base my code on. I am with Jim about being frustrated when trying to do anything manually in Storyline. I miss Flash. So much.
Hi Jay,
A way I found around this is to have a trigger on each slide that writes a unique identifier to a Storyline variable. You can then access this variable externally to manipulate it or watch it within Storyline.
Without knowing the specifics of your issue you could adopt the approach above with a watch trigger on the master slide to watch for a change in that variable then have a conditional statement to carry out your action depending on the value.
I hope this helps get you on the right path.
Ideally if we had access to the variables themselves we could avoid allot of manual trigger setup.
I'm creating an animated menu on the Master Slide using two layers--a "ShowMenu" layer for the opening animation and a "HideMenu" layer for the closing animation. Opening and closing the menu are beautiful things to behold. However, clicking on a menu item jumps to the desired slide--even if I put a trigger to show "HideMenu" before the "Jump to" trigger. It just happens too fast and looks like it's slamming shut--sloppy.
What I want is this:
I'm stuck because I don't know how to tell it to "jump to" a slide in JavaScript and I don't know how to refer to the slide so that the Player understands.
If I could use Condition in a trigger to say "If the variable is 1 jump to slide 1" else "if the variable is 2 jump to slide 2" I'd be super happy but it doesn't seem like Triggers can handle anything like that.
Hello Jay, Amir, Kevin;
I need revert back 5 seconds on the timeline whenever "" << Go Back 5 seconds" button clicked. I am very interested in seeing how you handle getting/setting and manipulating currentSlide information? Can you share your code/experiences with me?
Thanks
Refika
Hi Refika,
This thread is a bit older so I'd suggest reaching out to them directly using the contact me button on each of their profiles.
This discussion is closed. You can start a new discussion or contact Articulate Support.