Trigger not firing after JavaScript execution in HTML5
Aug 01, 2016
Hi,
Being able to use JavaScript in Storyline projects is very handy - but I seem to be having a problem with it in HTML5 (Storyline 2 Update 10).
In the Flash version of my project, triggers I add after an 'Execute JavaScript' trigger work as expected - but in the HTML5 version, it looks like triggers after the 'Execute JavaScript' trigger don't fire.
I've attached a basic Storyline project, and published versions below. When you click the 'Press' button: an 'Execute JavaScript' trigger changes the value of the TestVar variable to true; then a 'Jump to Slide' trigger jumps to slide 2 if TestVar is true.
The Flash version works as expected:
http://www.resources.vet.ed.ac.uk/test/js_trigger/story.html
But in the HTML5 version, the JavaScript is executed and the TestVar is changed by the JavaScript (as reported in the text box) - but the the slide doesn't change:
http://www.resources.vet.ed.ac.uk/test/js_trigger/story_html5.html
If the project is adjusted so the 'Jump to Slide' trigger is moved above the 'Execute JavaScript' trigger (and set to jump if TestVar is false), then the slide changes Ok in the HTML5 version - just not if the 'Jump to Slide' trigger is after the 'Execute JavaScript' trigger.
I've tested this on a Windows 7 PC, in: Firefox 38.3; Google Chrome 51.0; Internet Explorer 11. And on Safari for iOS 9.3.3 on iPad (the project is published with 'Use Articulate Mobile Player' unticked).
Is there something I'm not doing right that is stopping the triggers from firing?
Thanks,
Eoghan
8 Replies
Hi, Eoghan -- Thanks so much for reaching out here! Sorry to hear of your troubles, however, JavaScript is not something for which we are able to provide support, so we'll need to defer to your fellow JS-savvy community members to assist you further here.
Hi, thanks for your reply.
The problem isn't with the JavaScript code though, as the code is executing perfectly. The trouble seems to be Storyline not continuing after the JavaScript execution (and only a problem in the HTML5 version).
Thanks
Eoghan
Hi Eoghan,
Thanks for the clarification, and although we can't assist with the code specific elements, if things are not being trigger properly or different than before we'd want to take a look. I'd like to have you work directly with our Support Engineers on this and if you can provide the copy of the file and if you have a previous copy you create in Update 9 and didn't update to 10 to show the difference would be helpful.
Thanks Ashley,
Please see the example Storyline project file 'js_trigger.story', that I attached to my initial mail.
I don't have a version which works using a previous version of Storyline, so I don't know whether it used to work in previous versions of Storyline or not.
Thanks, Eoghan
Thanks Eoghan, I'm going to start a support case for you so that our engineers can more fully test out this issue as JS is well outside my area of expertise! You'll see an email from them shortly to confirm and then one of our Engineers will be in touch.
Good morning,
I've come across this problem as well. My work around was to use a Number Type variable. Here is an example.
Thanks Russell, that looks like a useful workaround.
The Articulate engineers are looking into this now, so I'll mention it to them to see if it will help them track down the trouble with True/False variables, and use Number vars in the meantime.
Thanks Russell for sharing what set up you've utilized to work around it, and if you'd also like our Engineers to take a look at Javascript that isn't executing in HTML5 output you can upload your files and examples to them here.
This discussion is closed. You can start a new discussion or contact Articulate Support.