Using Storyline variables to display or highlight

I have a Storyline text variable which, when I change it's value from a JavaScript, e.g., 

player.SetVar("myVariable", "yabadabbado");

I'd like an action to be performed on the slide.  

First, I'm not sure an action can be triggered if a variable's value is changed from JavaScript (JavaScript runs outside of the Storyline environment).  Could an image be shown for example?

11 Replies
Annie Jean

Hi Sam,

Storyline is not listening at the variable all through the process, it needs an action to tell it to look at the value of a variable.

If you want to set a trigger, it as to be from an action. Ex.: Change state of "Image" to Normal when (action e.g. user clicks) "Red button" if variable Equal to "wanted value".

You can also look at this thread, Phil gives some valuable information about it.

Hope it helps and don't hesitate to post back if you need further information.

Annie

Sij X

Hello everyone,

Following up on Sam's question, I am trying to use the same JS code as Sam (being executed at Timeline start), in my unit:

player.SetVar("myVariable", "yabadabbado");

I have a  text variable "myVariable" as well with a blank default value. The problem is that while creating a Flash output, the variable value is not being changed to "yabadabbado".

PS - I also tried the date time example (Javascript best practices) but there again the variable value is staying blank.

Suggestions please
 

Sij X

Thanks a ton, Phil. Works on my local machine using 'Publish to CD'. What does you mean by "security stopping it from working"?

Question now is, how do I get the same code to work when I would be publishing this unit as an HTML file (Flash output) and integrating it on a PHP website?I won't be able to use the exe from 'Publish to CD' on our website.