You can refer to any object remotely without being on that card. That avoids the use of a global or any other variable. Just read the label of the button no matter where it is:theotherbassist wrote: But the color specified in the menu label on Card 1 at the time the start button is clicked should determine which of the backgroundcolor variables will be linked to the tValue changes over time. (white: "tValue,tValue,tValue"; red: "tValue,0,0"; green: "0,tValue,0"; blue: "0,0,tValue") I know this must be really simple, I just can't seem to get the methodology.
Code: Select all
put the label of btn "menuButton" of card 1 into tColor
Code: Select all
put the label of btn "menuButton" of card 1 of stack "theOtherStack" into tColor
and even if the stack isn't open, as long as you know the file name:
Code: Select all
put the label of btn "menuButton" of card 1 of stack (specialFolderPath("documents") & "/mystack.livecode") into tColor
If you're going to use the color over and over again, then that's a good reason to retrieve it once and store it in a variable, especially if you're opening another file to get it, which is an expensive operation. But for a single retrieval you may as well just grab what you need and go.