Creating a variable inside of a rollout
Hey folks, I'm working on a small script and running into an annoying problem. Essentially when the user clicks a button, on the "pressed do" part of the roll out I want to create a variable, (such as "variableName = spinnerUserChanges.value") to then use multiple times during the next few lines (rather than constantly having to write "(spinnerUserChanges.value)".
But when I do this and try to run it constantly faults at that line.
I don't understand why this happens... is there a specific way you have to define variables while working with roll outs?
Much thanks!
Comments
Actually, scratch that, it
Actually, scratch that, it was because I wasn't setting brackets around the code... I had just one line of code so it worked fine, the second line then messed it up.
That always trips me up, silly mistake.
Thank you again.
Ah! I understand now that I
Ah! I understand now that I wasn't declaring it as either local or global... although I don't understand why I need to for a roll-out... to be honest I don't grasp why or when locals and globals need to be set.
Thank you though, you've saved me from a serious headache.
should not been a problem
Variant 1: store the value as local visible to
the whole rollout using spinner-handle:
or Variant 2: make it visible to the button only:
my recent MAXScripts RSS (archive here)