How to make variables global

I understand you can use the “script” keyword to make a variable global, however that doesn’t seem to work with all variables.

For example I was trying to make a timeSincePress (of an action button) variable to appear in a subsequent page, and it doesn’t seem to work.

Is there a general way to make variables global, or is a special approach necessary for each situation?

Thanks,

SE

Not sure why you’d want timeSincePress from another slide’s button. I think it resets to zero after a set amount of time or when you navigate to other slides, put focus on a table cell, etc. It’s just something like Button3.timeSincePress() to access it though.

In short, variables you create can be accessed globally using .script. Proper sources can be accessed by prepending with the source component name.