Hi, Suma -- Thanks for your question and welcome to the community! Unfortunately, I am not equipped to provide support on JavaScript coding, however, I did want to provide this information on JS Best Practices so you have it handy. I know we have lots of JS gurus in the community, so hopefully, someone will be able to chime in to assist you further! :)
I agree with Sebastian. Also, I don't quite see the need to use JS to add two Storyline variables and store the result in a third SL variable. You can do that with triggers.
5 Replies
Hi, Suma -- Thanks for your question and welcome to the community! Unfortunately, I am not equipped to provide support on JavaScript coding, however, I did want to provide this information on JS Best Practices so you have it handy. I know we have lots of JS gurus in the community, so hopefully, someone will be able to chime in to assist you further! :)
Hi Suma!
I think it works if you'll write the last line:
player.SetVar ("s", sum);
In your code the variable "s" gets the value "sum" !
I agree with Sebastian. Also, I don't quite see the need to use JS to add two Storyline variables and store the result in a third SL variable. You can do that with triggers.
Sebastian, thanks it works.
Micheal, could you elaborate more
thanks!
So glad to hear Sebastian's suggestion did the trick for you, Suma! Thanks for the update. :)
This discussion is closed. You can start a new discussion or contact Articulate Support.