I realized it would be nice to assign variables to buttons. While working on A Book About Hype, I figured out a solution. I was able to eliminate a lot of code – very ugly code – from one of my projects too.
The custom variable is the element's ID.
That's it.
So, if I want to know the active scene, I can use the following code in a custom function, which is run when the element is clicked...
scene = element.id;
It's not perfect, but it's a simple solution for many tasks. That's a lot easier than checking every scene – 30 times a second – to see if it's running.