Trigger buttons from other buttons

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
visionmill
Posts: 6
Joined: Fri Sep 12, 2014 2:32 pm

Trigger buttons from other buttons

Post by visionmill » Fri Sep 12, 2014 9:14 pm

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

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Trigger buttons from other buttons

Post by Simon » Fri Sep 12, 2014 9:38 pm

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

visionmill
Posts: 6
Joined: Fri Sep 12, 2014 2:32 pm

Re: Trigger buttons from other buttons

Post by visionmill » Fri Sep 12, 2014 9:43 pm

Thanks Simon. That is simple! I'll give it a go tomorrow.

Jonathan

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Trigger buttons from other buttons

Post by jacque » Sat Sep 13, 2014 7:21 pm

Picky point: put quotes around any commands that are issued using "send". It's not only faster, it's safer.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Trigger buttons from other buttons

Post by Simon » Sat Sep 13, 2014 7:28 pm

Jacque is correct...
send "mouseUp" to btn 1 in 1 millisec

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply