LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!
Thanks for your reply - unfortunately grouping the objects won't help here.
I need different elements (objects/buttons) to be shown or hidden depending on which buttons are activated. I would imagine writing scripts to group and ungroup different collections of objects in order to hide or show them, would be much the same as simply listing each of them for each button.
I tried using square brackets, eg: ["ButtonOne" "ButtonTwo" "ButtonThree"], but that doesn't work either...
Name the buttons as Button1, Button2, Button3 then use a loop such the following:
on mouseUp
repeat with i = 1 to 3
hide button ("button" & i)
end repeat
end mouseUp
I can see the logic with this - very neat, but I would have to add something to exclude particular buttons I don't want hidden.
Out of interest... Is it recommended to use a loop like described above and not recommended to have a list (like I've described in my initial post above), which includes say 20 buttons? Or does it make little difference which way it's done?
If you have to live with the loop solution, remember to "lock screen" at the start of your script. It'll run much faster and will avoid any strange screen effects as items disappear.
I must say - this forum is invaluable for beginners/dabblers like me.
A big Thank You! to everyone who contributed to this post! Each contribution has been helpful and Michael's sample stack is a neat bonus. I feel I have a lot to move forward with now...
You might want to lock the screen at the start of your script and unlock it at the end (search for lockScreen in the dictionary).
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode