Change variable when I click on different web objects in the same layer

Nov 01, 2020

Hello Heroes!,

I have a question and I don't know if it is possible to do it.

In the same layer I have different web objects (audio player in HTML) and I want that when I click on one of them it changes a numerical variable to show one layer or another (audio transcription).

Would it be possible to do it with javascrip? I have tried to do it but I don't know how to call each of the different web objects in the code to put one value or another in the variable so that it shows the corresponding layer.

For example, if I click on the web object 1 the variable Audio = 1, and with a trigger it will show layer 1, if I click on the web object 2 the variable Audio = 2 and it will show layer 2 and so on with all .

Thanks a lot

1 Reply
OWEN HOLT

I think this might prove difficult. You would need to add JavaScript in your HTML pages to:

  1. Create an even listener (when user clicks) to trigger a JavaScript action...
  2. the JavaScript action would need to control a global variable

 

Your Storyline file would need to have a JavaScript event listener to:

  1. detect the changes to the global variable and send a value based on those changes to Storyline
  2. You would need to trigger an action in Storyline to show layer when the change is sent from the prior event listener.

...and of course, all of this assumes that all of your html pages are hosted on the same domain. 

Basically, you are trying to send data upward from a page contained within an iFrame within the player to the page that holds the player so it can be sent back down from the page to the player.

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