why "JavaScript best practices and examples" does not work

Aug 11, 2013

Hi,

I just downloaded a trail version Storyline and tried the JavaScript example as described in "JavaScript best practices and examples" at  http://www.articulate.com/support/kb_article.php?product=st1&id=llwes8cn32vg . Why this example does not work? I really need JavaScript in Storyline to implement a free-run simulator (very difficult to use interactions). If someone can provide an working example (.story) for "Execute JavaScript" trigger, that will be greatly appreciate.

19 Replies
Justin Grenier

Good Morning Shawn, and welcome to Heroes!

I'm not having any trouble with the first example within the article you referenced.  Did you try following Brian's Screenr Tutorial?

Here is a working example of a .story project file, and here is the resulting output.

Please let us know if you have any other trouble, and have a great day!

Shawn Wang

Hi Justin,

I really appreciate your quick response to my question.

I tried your example, if I only publish to WEB (no HTML 5 and mobile device), storyline generate story.html and I double click story.html to bring it up in IE or Chrome, the JavaScript does not work. If I check the "Include HTML 5 output", Storyline generates both story.html and story_html5.html. I double click story_html5.html to bring it up in Chrome, the JavaScript worked, but in IE, it says unsupported browser. And story.html still does not work. See the attached PublishAsWebOnly.jpg and PublishAsWebAndHtml5.jpg to see how I published, and story_html.jpg for story.html screenshot with flash player version information, story_html5_html.jpg for HTML 5 screenshot.

I just installed a new Windows 7 machine and installed the latest flash player(Adobe Flash Player 11 ActiveX). Is my flash player different from yours?

JavaScript is very critical for my project (with dynamic simulator) to use Storyline. Any help and information will be greatly appreciated!

Note: here only allow one attachment, I put all screenshots in one MS Word .doc file

Justin Grenier

Hello again, Shawn.

If you view published Storyline content on your local hard drive or send it to someone else to view on their local hard drive, you'll encounter security restrictions from the computer, web browser, Flash Player, and network that'll cause various features of your content to fail.

To properly test your published content and share it with others, upload it to the environment for which it was published as described in this article.

Please let us know if you need anything else.  Thanks!

Shawn Wang

Justin,

Millions of thanks to you! It worked after I uploaded the published contents to tempshare.

One more question: my simulator need to use LED true type fonts. Is there a way bind the true type fonts with the published contents so that users (other people browse the course) will not need to install the LED true type fonts on their machine?

Shawn Wang

Leslie,

I still could not get the custom fonts working on other machines other than my machine installed the LCD and LED true type fonts. Please click this link http://s3.amazonaws.com/tempshare-stage.storyline.articulate.com/stp182cj23jh1s8i7p11f8ru7bc4/story.html to see if you can get the same LCD and LED fonts displayed as the same shown in the attached screenshot. I click this same link will get the LCD and LED fonts displayed correctly.

Thanks,

Shawn

Leslie McKerchie

Hi Shawn!

No, I could not see the fonts as you intended.  So, we knew that custom fonts were not supported for variable references in HTML5 output, but the fact that it fails in flash is a new find.

It has been reported to QA to look into and I will track it and keep you posted.  I cannot, however, offer a timeline or workaround at this time.

Thanks.

Shawn Wang

Hi Leslie and Justin,

Does Storyline support JavaScript for LMS/SCORM2004? I can get JavaScript work beautifully in WEB and CD mode, but not in LMS mode.

After I published my Storyline course in LMS mode(SCORM 2004 3rd), I added under the resource tag group,  and also updated the story.html file the same way as in WEB mode by adding right before , and then zipped the directory, uploaded to SCORM system. Do I miss anything here to get JavaScript work in SCORM?

Thanks,

Shawn

Trip Levine

I'm with the original post, Shawn Wang downloading the example and it not working as story.html, and only as story_html5. I would like to use the story.html and *not* the story_html5 file. 

I notice however that Internet Explorer 11 is the only browser that can read story.html's javascript. Firefox, Chrome, and Safari all fail. Very strange indeed. 

How can I get a published story.html to execute javascript? Is that even possible?

I did go to that link, and study thoroughly all the different export options, and none of those worked.

Patrick Smith

Justin Grenier said:

Good Morning Shawn, and welcome to Heroes!

I'm not having any trouble with the first example within the article you referenced. Did you try following Brian's Screenr Tutorial?

Here is a working example of a .story project file, and here is the resulting output.

Please let us know if you have any other trouble, and have a great day!


Justin, i too have a similar issue. I've been trying to implement a javascript trigger, with no results. I dumped everything and tried a hello world sample via the alert function, but nothing. I've tried running your resulting javascript_example link and every browser comes back with the "unknown" string instead of the date. I've tried FF, Chrome and IE.

All have javascript enabled.

Any suggestions on next steps?

Thanks,

Pat

Justin Grenier

Good Afternoon, Pat.

Three colleagues and I just tested this example in Chrome, IE, and Firefox. It worked flawlessly for all four of us in all three browsers. Are you trying the same example, or are you downloading my .story project file and publishing/testing it?

  • Please let us know if you need anything else, and have a great day!

This discussion is closed. You can start a new discussion or contact Articulate Support.