Use a trigger to create a variable?

I'm trying to create some pre-made templates to cover various situations and am wondering if it is possible to use a trigger (JavaScript?) to create a variable that could then later be set by other more standard triggers.

For instance, if I create an FAQ template that may include several screens/layouts (2, 3, 4, 5, 6, or 7 buttons) I would currently have to manually create the maximum number of variables (7) even if the 2 button screen will only need 2 variables.

I would like each screen to be able to "create" only the number of variables needed for its own use.

Anyone know if this is possible?

3 Replies
Christie Pollick

Hi, Scott -- As stated in this article, "Storyline makes working with variables easy. Without writing a single line of code, you can create and trigger variables." Please check out the article and let us know if that will do the trick. 

And I also wanted to note as you mentioned JavaScript, unfortunately, we are not able to provide support for JavaScript coding. Luckily, we have lots of community members who are more than willing to share their expertise to assist!

And for those who'd like to review it, here is a sheet on JavaScript Best Practices you may want to keep handy. :)

Scott Wiley

Thanks Christie and Phil.

I'm very knowledgeable of how to manually add and later change variables via a trigger.

I was hoping that besides just the "Get" and "Set" variable options, I might be able to do a kind of hack to have a trigger "Create New" a variable based on how many variables my individual imported template might need.

So to borrow from other coding methods (ActionScript or JavaScript) it might be analogous to something like:

var MyVariable:Text = "My text variable "

I guess there is no harm in creating all the possible variables that "may" be required with the knowledge that some of the imported variables will remain empty, or their initial state, and unused.

Thanks anyway.