This is a working example of Web Object communication with Storyline for beginners. It should work for most of you.
2 Way Communication
1. Basically, there is a Storyline button on the main stage that calls a function within its own Web Object when you press it.
2. That function (which is on the index.html file of the WO) then makes an alert window, and sends back a variable change (True) to Storyline. Storyline then opens a layer when it notices the boolean variable change.
*The alert window is arbitrary. You can put anything you want in your function. (I put the alert there to let me know it was being called ), but passing that variable is key to communication with Storyline.
- Some tips here. You will need to first publish this file, then dig into the published folder and get the index.html file hiding in the WebObject folder.
- You will then need to make your own folder to put a copy of the index.html into. Web Objects need folders containing index.html files that you target. This is done by right-clicking and editing the gray WebObject on the Storyline stage.
- The folder name needs to be changed every time you edit code in your index.html, and won't rewrite it otherwise.
- Firefox seems to work best when testing JS locally.
This is not a tutorial, just a working file for you to dissect. If you can't figure out why you would ever need this file, then you probably don't need it.
I built this because I was tired of digging around the forum looking for JS tips and just wanted to see a working sample for myself. Hope this helps.