Page 1 of 1

Trigger buttons from other buttons

Posted: Fri Sep 12, 2014 9:14 pm
by visionmill
Hi

I've just started using livecode having not done anything like this before.

I've created a few buttons which work as expected. For example one button when pressed will change the background colour. Press it again and the colour changes back to the original.

What I would like is to create a new button that would mimic me pushing these two other buttons. A bit like creating a macro.

Is this possible? How would I do it?

Thanks

Re: Trigger buttons from other buttons

Posted: Fri Sep 12, 2014 9:38 pm
by Simon
Hi visionmill,
This is easy in liveCode :)
in the third button put
send mouseUp to btn 1 in 1 millisec
send mouseUp to btn 2 in 1 second
You should use the actual names of your buttons in there unless you understand the layering of controls.

Simon

Re: Trigger buttons from other buttons

Posted: Fri Sep 12, 2014 9:43 pm
by visionmill
Thanks Simon. That is simple! I'll give it a go tomorrow.

Jonathan

Re: Trigger buttons from other buttons

Posted: Sat Sep 13, 2014 7:21 pm
by jacque
Picky point: put quotes around any commands that are issued using "send". It's not only faster, it's safer.

Re: Trigger buttons from other buttons

Posted: Sat Sep 13, 2014 7:28 pm
by Simon
Jacque is correct...
send "mouseUp" to btn 1 in 1 millisec

Simon