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?
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.
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.
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.
Hi Sij - what Phil means is that many of the browsers will block JavaScript from running on your computer when you are launching the content locally (i.e., from your computer). The code should work fine when you integrate it with your website and run it over the internet.
11 Replies
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
If you add a trigger as Annie describes on the slides for when variable changes then this should work.
The trigger is only checking if the variable has changed so it is irrespective of if it was changed via javascript or within storyline
Thanks for the support Annie, I am voting you for superhero!
Thanks Phil that's nice but I don't feel in the same league...
I just have fun helping with what I know and learn from all of you.
Have a nice weekend!
Yes, Annie Jean for superhero.
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
publish to CD and run the exe. Think you are running local and security is stopping it work
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.
Hi Sij - what Phil means is that many of the browsers will block JavaScript from running on your computer when you are launching the content locally (i.e., from your computer). The code should work fine when you integrate it with your website and run it over the internet.
Thanks Nancy. I thought so. It's working fine now
In a pinch, I use http://tempshare.articulate.com/ instead of publishing to CD.
This discussion is closed. You can start a new discussion or contact Articulate Support.